How can I get headings on parent page (ie <h1>) to be set as news title?

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
mrsi
New Member
New Member
Posts: 2
Joined: Fri Aug 06, 2010 6:28 am

How can I get headings on parent page (ie <h1>) to be set as news title?

Post by mrsi »

CMSMS 1.7.1
News module 2.10.5

Hi, I've been trying to get the page tiltle AND a {title} block change to the title of the news article when the news detail is displayed. I've got the page title changing no probs using this technique:

http://forum.cmsmadesimple.org/index.ph ... 75.45.html

I've tried setting it in a capture like this...

In my news detail:

Code: Select all

{assign var='news_title' value=$entry->title}
In the head of my page template:

Code: Select all

{if isset($news_title)}
{capture assign='page_title'}{$news_title}{/capture}
{else}
{capture assign='page_title'}{title}{/capture}
{/if}
Further down in my template:

Code: Select all

<h1>page_title</h1>
But whenever I do a capture the variable is empty. What am I doing wrong?
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: How can I get headings on parent page (ie <h1>) to be set as news title?

Post by Dr.CSS »

Have you tried {$page_title}?...
Ziggywigged
Power Poster
Power Poster
Posts: 424
Joined: Sat Feb 02, 2008 12:42 am

Re: How can I get headings on parent page (ie <h1>) to be set as news title?

Post by Ziggywigged »

You'll want to try CGs methods for dynamic titles here:
http://calguy1000.com/Blogs/4/60/the-website-saga---smarty-template-madness.html
Take a penny, leave a penny.
mrsi
New Member
New Member
Posts: 2
Joined: Fri Aug 06, 2010 6:28 am

Re: How can I get headings on parent page (ie <h1>) to be set as news title?

Post by mrsi »

Dr.CSS wrote: Have you tried {$page_title}?...
oops ;)

Yeah I was doing $page_title, just somehow didn't paste it in properly on this forum.

@ziggy - I'll try that, thanks.
Post Reply

Return to “CMSMS Core”