[Solved] News title not Page title

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
oceanblue
New Member
New Member
Posts: 7
Joined: Sun Nov 28, 2010 3:43 am

[Solved] News title not Page title

Post by oceanblue »

Now, I know this should be easy and managed to do it in the old version of news, but I can't get the 'Title' of the news article to be the page 'Title'. It just shows up as the page that I use to show all news items!!??

Thanks and sorry for being dumb ::)
Last edited by oceanblue on Wed Dec 01, 2010 1:04 am, edited 1 time in total.
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: News title not Page title

Post by Wishbone »

I don't know if there is an easier way in the newest versions of CMSMS, but in my template, where you normally see {title}, I put:

Code: Select all

{if isset($news_title)}
<title>{sitename} - {$news_title}</title>
{else}
<title>{sitename} - {title}</title>
{/if}
and in my news template, at the end I put:

Code: Select all

{assign var='news_title' value=$entry->title}
This last piece sets the value of an arbitrary variable called 'news_title', which we pick up when processing the

This only works when 'process_whole_template' is false (the default) in config.php. This allows the (where we figure out what the title is) to be processed before the .
Last edited by Wishbone on Tue Nov 30, 2010 2:29 am, edited 1 time in total.
oceanblue
New Member
New Member
Posts: 7
Joined: Sun Nov 28, 2010 3:43 am

Re: News title not Page title

Post by oceanblue »

Fantastic  8)
That worked a treat!!

On another note:
how can you get smarty tags processed in RSS feeds?
mine just come up in literal text
eg:

Code: Select all

{CGFeedMaker action='rsslink' feed='OBAnews'}
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: News title not Page title

Post by Wishbone »

You might want to put your second question in it's own topic.
oceanblue
New Member
New Member
Posts: 7
Joined: Sun Nov 28, 2010 3:43 am

Re: [Solved] News title not Page title

Post by oceanblue »

Thanks for all the help.

In order to process the cms-selflinks changed feed template to this:

Code: Select all

{capture assign='description'}{eval var=$entry->summary}{eval var=$entry->content}{/capture}
Then changed url-rewrite to internal and everything looking good  :D
Post Reply

Return to “Modules/Add-Ons”