Page 1 of 1

Creating Unique Blog Titles For Every Page

Posted: Sat Apr 17, 2010 7:09 pm
by Maccsta
Thanks to Gavin this is the code that will remove the site’s main page title from the end of every blog post title when added to the index template:

Code: Select all

<title>
{if $view == 'entry'}{$entry.title}
{else}
{$head_title|@default:$blogTitle} {if $head_subtitle} - {$head_subtitle}{/if}
{/if}
</title>
However how do I implement the code to do the same for static pages and categories?

Also is it possible to make a custom title for each of the main pages e.g.
My Cool Blog – Page 2
My Cool Blog – Page 3
My Cool Blog – Page 4
So that none of the pages have exactly the same page title.

Thanks for any help. This would be useful for everyone’s blog titles.

Re: Creating Unique Blog Titles For Every Page

Posted: Sun Apr 18, 2010 10:12 am
by yellowled
Maccsta wrote:However how do I implement the code to do the same for static pages and categories?
I think I can help with that :)

Code: Select all

<title>
{if $view == 'entry'}{$entry.title}
{elseif $staticpage_pagetitle}{$staticpage_pagetitle}
{elseif $view == 'categories'}{$category_info.category_name}
{else}{$head_title|@default:$blogTitle} {if $head_subtitle} - {$head_subtitle}{/if}
{/if}
</title>
That should do the trick for that part of your question.

YL