X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Tweak Category Titles for Better SEO v4.x (https://forum.x-cart.com/showthread.php?t=32577)

PhilJ 07-16-2007 05:41 AM

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


All times are GMT -8. The time now is 09:54 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.