News page template loading and multiple article detail URLs?

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
rbaby
Forum Members
Forum Members
Posts: 144
Joined: Thu Feb 07, 2008 10:28 pm

News page template loading and multiple article detail URLs?

Post 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.
JohnnyB
Dev Team Member
Dev Team Member
Posts: 729
Joined: Tue Nov 21, 2006 5:05 pm
Location: OH, USA

Re: News page template loading and multiple article detail U

Post 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.
"The art of life lies in a constant readjustment to our surroundings." -Okakura Kakuzo

--
LinkedIn profile
--
I only speak/write in English so I may not translate well on International posts.
--
rbaby
Forum Members
Forum Members
Posts: 144
Joined: Thu Feb 07, 2008 10:28 pm

Re: News page template loading and multiple article detail U

Post by rbaby »

Thanks so much, I overlooked that detailpage parameter.
User avatar
paulbaker
Dev Team Member
Dev Team Member
Posts: 1465
Joined: Sat Apr 18, 2009 10:09 pm
Location: Maidenhead, UK
Contact:

Re: News page template loading and multiple article detail U

Post by paulbaker »

Great answer JohnnyB, I was going to answer this myself but you did a much better job than I would have done. ;)
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: News page template loading and multiple article detail U

Post by Rolf »

Use the canonical link in your templates.
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
User avatar
fearmydesign
Power Poster
Power Poster
Posts: 363
Joined: Sun Feb 28, 2010 10:54 pm

Re: News page template loading and multiple article detail U

Post 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?
Rod
"Be careful who you step on your way up; because you never know who you'll meet on your way down!" - or something like that.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: News page template loading and multiple article detail U

Post 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}
Post Reply

Return to “The Lounge”