Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Tweak Category Titles for Better SEO v4.x

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 07-16-2007, 05:41 AM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default Tweak Category Titles for Better SEO v4.x

It's fair to say that your <title> tags are one of the most important elements on your pages for SEO.

Here's an easy way to add extra keywords to your category page titles via the 'category modify' page.

1) Patch your database via Patch/Upgrade

Code:
ALTER TABLE `xcart_categories` ADD `category_seo` VARCHAR( 255 ) NULL ;

2) In skin1/admin/main/category_modify.tpl

Add the following code...

v4.0.x

Code:
{* Category Title SEO Mod Start 4.0.x *} <TR> <TD height="10" class="FormButton" nowrap>{$lng.lbl_category} {$lng.lbl_title}:</TD> <TD width="10" height="10">&nbsp;</TD> <TD height="10"><INPUT type="text" name="category_seo" size="65" value="{if $category_error ne ""}{$smarty.post.category_seo}{elseif $mode ne "add"}{$current_category.category_seo}{/if}"> </TR> {* Category Title SEO Mod End 4.0.x *}

v4.1.x

Code:
{* Category Title SEO Mod Start 4.1.x *} <tr> <td height="10" class="FormButton" nowrap>{$lng.lbl_category} {$lng.lbl_title}:</td> <td width="10" height="10">&nbsp;</td> <td height="10"><input type="text" name="category_seo" size="65" value="{if $category_error ne ""}{$smarty.post.category_seo|escape:"html"}{elseif $mode ne "add"}{$current_category.category_seo|escape:"html"}{/if}"> </td> </tr> {* Category Title SEO Mod End 4.1.x *}

3) In admin/category_modify.php

Add the following code in red...

v4.0.x

Code:
# # Update general data of category # db_query("UPDATE $sql_tbl[categories] SET category='$category_name', description='$description', meta_descr='$meta_descr', meta_keywords='$meta_keywords', avail='$avail', category_seo='$category_seo', order_by='$order_by', membership='$cat_membership' WHERE categoryid='$cat'");

v4.1.x

Code:
# # Update general data of category # db_query("UPDATE $sql_tbl[categories] SET category='$category_name', description='$description', meta_descr='$meta_descr', meta_keywords='$meta_keywords', avail='$avail', category_seo='$category_seo', order_by='$order_by' WHERE categoryid='$cat'");

4) In skin1/customer/home.tpl

Add the following code in an appropriate place within your <head> tag...

Code:
{if $current_category.category_seo}&nbsp;{$current_category.category_seo}{/if}

Done

I'd recommend this mod also...
http://forum.x-cart.com/showthread.php?t=19842
__________________
xcartmods.co.uk
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 08:52 PM.

   

 
X-Cart forums © 2001-2020