Page 1 of 1

Why do dynamic titles work with the News module but not Blog in 1.5.2?

Posted: Mon Feb 23, 2009 1:04 pm
by eluminous
I have an interesting situation where I can get dynamic titles to generate on a "per news item" basis in the News module but not with the Blogs module.

I am utilising a code variation from Calguy which includes placing this code in the "Blog template" tab of the Blogs module:

Code: Select all

{assign var='pagetitle' value=$entry->title}
And this code in the head of the page template from where the {Blogs} content is being called:

Code: Select all

<title>{$the_pagetitle}</title>
And finally, this code just following the templates opening tag:

Code: Select all

{content assign='mycontent'} {*generates detail view titles*}
{* allow adjusting the page title, using a default *}
{if isset($pagetitle)}
{capture assign='the_pagetitle'}{$pagetitle} | {sitename}{/capture}
{else}
{capture assign='the_pagetitle'}{title} | {sitename}{/capture}
{/if}
What happens is this: The title is generated for the first post of the whole blog, but when viewing any other categories or posts, the default blog page title is displayed. This seems to work fine for News but not blogs...

Re: Why do dynamic titles work with the News module but not Blog in 1.5.2?

Posted: Sat Feb 28, 2009 3:43 am
by eluminous
Could it be that very few people have tried to implement dynamic Blog titles into their cms? or simply that nobody knows what I am talking about?

If the Blogs module is in most instances using similar code to the News module, why does this work in "News" but not "Blogs"? It must have something to do with the 'Blogs' templates. Any thoughts at all?

Very strange indeed...

Re: Why do dynamic titles work with the News module but not Blog in 1.5.2?

Posted: Sat Feb 28, 2009 7:08 am
by JeremyBASS