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.
Add A Comment