View Single Post
  #1  
Old 02-09-2006, 12:57 AM
 
TJ Stephens TJ Stephens is offline
 

Advanced Member
  
Join Date: May 2005
Location: California
Posts: 94
 

Default Display Only Current Page in Page Title

I am not sure if this is worthy to be in the custom mods section but I will post anyway since I could not find a clean way to do this on the forum.

Xcart currently gives you only two options for page title format: (1) "Shop Name :: Category Name :: Product Name," or (2) "Product Name :: Category Name :: Shop Name." This mod adds a third option called "Current Page Only" which displays only the current page you are viewing. Some people claim this helps with SEO.

For example, if you are on the home page, it will display your site name as the page title, if you are viewing a category, it will display the category and nothing else, and if you are viewing a product then it will display the product name and nothing else, etc...

First, edit skin1/admin/configuration.tpl and find the following code:

Code:
{elseif $configuration[cat_num].name eq "page_title_format"} <SELECT name="{$configuration[cat_num].name}"> <OPTION value="A" {if $configuration[cat_num].value eq "A"}selected{/if}>Shop name :: Category name :: Product name</OPTION> <OPTION value="D" {if $configuration[cat_num].value eq "D"}selected{/if}>Product name :: Category name :: Shop name</OPTION> </SELECT>

Then add the following line after the last option:

Code:
<OPTION value="G" {if $configuration[cat_num].value eq "G"}selected{/if}>Current Page Only</OPTION>

Then edit skin1/customer/home.tpl and replace everything between the <TITLE> tags with the following:

Code:
<TITLE> {if $config.SEO.page_title_format eq "A"} {section name=position loop=$location} {$location[position].0|escape} {if not %position.last%} :: {/if} {/section} {elseif $config.SEO.page_title_format eq "D"} {section name=position loop=$location step=-1} {$location[position].0|escape} {if not %position.last%} :: {/if} {/section} {elseif $config.SEO.page_title_format eq "G"} {section name=position loop=$location} {if %position.last%}{$location[position].0|escape}{/if} {/section} {/if} </TITLE>

Finally, make sure that you have selected "Current Page Only" in the admin area under General Settings --> SEO Options --> Page Title Format. This was done in 4.0.14. It may be different in other versions but you get the idea. Hope that helps.

T.J.
__________________
X-Cart Pro 4.1.11 (Live)
XRMA
XAFF
XAOM
DSEFU Pro
XGift Reg
Firetank Feed Manager
BCSE Shipping Calculator
XcartMod Dynamic Images
Reply With Quote