Page 1 of 1

[SOLVED] How to don't print out identical title and sitename

Posted: Mon Mar 28, 2011 7:48 am
by pustofkj
Hi all, my question is obvious from my subject, I think. I'm printing out "title | sitename" to my web title, but I wouldn't like to print out both of them when title is the same as sitename. In this case want get out only "sitename". How could I do it? Thanks :-)

Re: How to don't print out identical title and sitename

Posted: Mon Mar 28, 2011 4:26 pm
by Wishbone
Several ways to do it..

The easiest way would be to replace the {title} | {sitename} with

Code: Select all

{if $page_alias == 'home'}
  <title>{* put something else here *}</title>
{else}
  <title>{title} | {sitename}</title>
{/if}
A cleaner way would be to define a one-liner content block called 'alt_title' where the content editor can override any page he/she wishes without needing to modify a template. Similar logic would have to be in the template, but would be using $alt_title instead of $page_alias.