[solved] Created news title visible to body section
Posted: Mon Jul 15, 2013 5:16 am
I'm confused, so hopefully someone could point my error.
I have managed to do this a few times, but almost every time I get stuck and now I just can't figure out, what's wrong.
In news detail template I have created variable:
In page template I use it when creating a page title:
But if I try to use $news_title in the body section, it is null. For example with following code, it always show "title" - not "news_title":
What I'm missing?
I have managed to do this a few times, but almost every time I get stuck and now I just can't figure out, what's wrong.
In news detail template I have created variable:
Code: Select all
{assign var='news_title' value=$entry->title}
Code: Select all
{if isset($news_title)}
{capture assign='createdTitle'}{$news_title} - {sitename}{/capture}
{else}
{capture assign='createdTitle'}{title} - {sitename}{/capture}
{/if}
<title>{$createdTitle}</title>
Code: Select all
<h1>
{if isset($news_title)}
{$news_title}
{else}
{title}
{/if}
</h1>