Page 1 of 1

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

Posted: Fri Aug 06, 2010 6:50 am
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?

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

Posted: Fri Aug 06, 2010 8:09 pm
by Dr.CSS
Have you tried {$page_title}?...

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

Posted: Fri Aug 06, 2010 8:16 pm
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

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

Posted: Mon Aug 09, 2010 5:27 am
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.