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

General project discussion. NOT for help questions.
Post Reply
User avatar
eluminous
Forum Members
Forum Members
Posts: 36
Joined: Fri May 02, 2008 3:26 am

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

Post 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...
User avatar
eluminous
Forum Members
Forum Members
Posts: 36
Joined: Fri May 02, 2008 3:26 am

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

Post 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...
Post Reply

Return to “General Discussion”