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"} 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> 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. |
Just thought I'd say thanks for this mod... makes absolute sense for SEO.
|
Works great, one question though
Because say for example the help pages are essentially the same page but with just different language variables controlled by the appending variable in the url string, how would I stop it from displaying the same title tag all the way through. In my home.tpl i used to have Code:
{elseif $main eq "product"}{if $product.product ne ''}{$product.product} | {if $current_category.page_title eq ""}:{$current_category.category_name|regex_replace:"/.*\//":""}:{$config.Meta.site_title}{else}{$current_category.page_title}{/if}{/if} After the last {if} statement but if I try to input that with this i just get a blank page. |
You should be able to add the variables for the help pages in between the {/section} and {/if} in the code below:
Code:
{elseif $config.SEO.page_title_format eq "G"} |
Its ok I sorted it easy enough - i'll put it down to a case of being totally knackered.
One thing i've lost (which may of happend well before this) is the ability to have the page title that is entered in static pages shown - at the moment it just displays the default title of "HOM underwear" , anyone have the code to hand before I sift through the defaut x-cart distro for it. |
Version 4.1.1 is different. I do not see skin1/admin/configuration.tpl file. There is a configuration.tpl file in skin1/admin/main. But it does not have the code for the title format dropdown. Does anyone know where to find the code in 4.1.1?
One way to workaround is just using Code:
<title> Code:
<title> Thanks for sharing. |
Re: Display Only Current Page in Page Title
For version 4.1.6, there's no need to change configuration.tpl. Just add an option "G: Current Page Only" to cell titled "page_title_format" in xcart_config table (around page 5) using phpMyAdmin, and select this option G from backend Admin.
|
Re: Display Only Current Page in Page Title
Don't forget, if you use Fast Lane Checkout in version 4.1.x, this file should also be modified: \skin1\modules\Fast_Lane_Checkout\home.tpl.
|
Re: Display Only Current Page in Page Title
Nice mod...I would recommend Produt Meta tags and Titel Tags Plus from BCSE!
|
Re: Display Only Current Page in Page Title
Gives you the liberty to add cutom titles etc.... excellent for SEO
|
All times are GMT -8. The time now is 11:27 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.