Adding Search Phrase to Title (CMSMadeSimple)

Feb 6, 2009

How to add the search query to you title tag in CMSMadeSimple
Category: Posts
Posted by: jordonr
While looking at the pages that google indexed of my site I noticed that a lot of them had the title of home. The majority of them were search queries, I guess the search results are shown on the default page. The title tag doesn't seem very useful in this instance as it's duplicated many times. So to make it more descriptive and useful I added the phrase that was searched to the title tag. This was pretty simple and was done as follows:
{if isset($phrase)}
{$phrase} - {sitename}
{else}
{title} - {sitename}
{/if}
What it does is checks if the variable $phrase is set, if it has a value. If that is true it puts that phrase in to the title tags. If the variable $phrase is not set, does not have a value, it defaults to to my traditional title tag.
Title tag, CMSMadeSimple, Smarty
Add A Comment

Add A Comment


Code in the picture:
Title:
Your Name(*):
Email:
Notify me of any further comments to this thread:
Website:
Comment(*):