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

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
pustofkj
Forum Members
Forum Members
Posts: 19
Joined: Fri Feb 04, 2011 1:57 pm

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

Post 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 :-)
Last edited by pustofkj on Tue Mar 29, 2011 5:15 am, edited 1 time in total.
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

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

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

Return to “CMSMS Core”