Page 1 of 1

News page template loading and multiple article detail URLs?

Posted: Wed Feb 05, 2014 5:36 am
by rbaby
Hello guys,

I was hoping to get some insight on how to address this...I have a global news ticker on the top. My problem is that my pages all have different layout templates. However, when I click on the news item on the global ticker, it will ALWAYS load the news in the current template which may not be the correct one (such as a 5-column slider-banner template).

Is there any way that I can force the news ticker article detail links to a specific page template (my single column for article view)?

I also notice that depending on the page you click on the article on, the URL changes. For example, on my home page I will click on this article and I will get:

/news/1/15/article as the detail URL

But when I go to my contact page and click the same article, the URL is:

/news/1/90/article as the detail URL

and in another page it will be different again:

/news/1/68/article

I have pretty URL's installed, but I would like to have 1 link for the article...how do I normalize this? Ideally it would just be /news/article - I don't know what those numerical prefixes are for...

Thanks guys! Appreciate your time and help.

Re: News page template loading and multiple article detail U

Posted: Wed Feb 05, 2014 11:18 pm
by JohnnyB
use the detailpage='' option in your news tag
and/or set the default news detail landing page in the module's settings

Regarding the generated links like:
/news/1/15/
-- the '15' is the content page ID that the article is being linked to and viewed on. Same as '90' and '68' in your examples.
-- the 1 is the article's ID #

So, with the news module, you can change the '15' and the stuff after the '15' to anything and it will load the article with an ID of 1

For example, try going to /news/1/20/a-fake-article-title and the article with an ID of 1 will load (assuming you have a page with content ID = 20)

There is also the news URL option that will eliminate all of the IDs and just use your desired alias.
But, you need to be using the news from CMSMS versions 1.10+
Setting the URL for each article will then make them load as: mysite.com/my-article-alias
But, they will look for a default detail page that needs to be set in the news options or will open in the same page the link/summary is being viewed in.

Re: News page template loading and multiple article detail U

Posted: Wed Feb 05, 2014 11:25 pm
by rbaby
Thanks so much, I overlooked that detailpage parameter.

Re: News page template loading and multiple article detail U

Posted: Thu Feb 06, 2014 10:38 am
by paulbaker
Great answer JohnnyB, I was going to answer this myself but you did a much better job than I would have done. ;)

Re: News page template loading and multiple article detail U

Posted: Thu Feb 06, 2014 9:20 pm
by Rolf
Use the canonical link in your templates.

Re: News page template loading and multiple article detail U

Posted: Fri May 02, 2014 12:00 am
by fearmydesign
Rolf wrote:Use the canonical link in your templates.
Hi Rolf, just doing a little forum research. How would you set up a canonical on a News template?

Re: News page template loading and multiple article detail U

Posted: Fri May 02, 2014 7:37 pm
by Dr.CSS
It is set up in the <head> of your page template not the News templates...

{if isset($canonical)}<link rel="canonical" href="{$canonical}" />{elseif isset($content_obj)}<link rel="canonical" href="{$content_obj->GetURL()}" />{/if}