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)
-   -   Here is How to Change Page Title Tag Format (remove "::") (https://forum.x-cart.com/showthread.php?t=53332)

gallaghersean 04-17-2010 09:49 PM

Here is How to Change Page Title Tag Format (remove "::")
 
I figure I'd pass this along for anyone else wanting to know how to do this. If you want to change the format of the default :: character separator follow these instructions.

I don't know why X-Cart choose a double colon for a separator in their title tags it does not make much sense SEO-wise. The best format for the title tag is: Product Name - Category | Site Name. That is the best format for search engine according to current studies (reference: Best SEO Practices by SEOmoz).

So now on to the details... to change the format follow these steps:

For Page Titles like this: Product Name - Category - Site Name
  1. Open up the file include/templater/plugins/function.get_title.php
  2. Go to line 107.
  3. On this line you will find implode(' :: ', $tmp))); at the end of the line of code change the :: out for the - character or whatever you want. Now this will make your title tags look like this Product Name - Category - Site Name
For Page Titles like this: Product Name - Category | Site Name
  1. First make sure you have the setting in Main page :: General settings :: SEO options :: Page title format set to Product name :: Category name :: Shop name
  2. Open up the file include/templater/plugins/function.get_title.php
  3. Go to line 107.
  4. Replace that entire line
    $title = str_replace(array("\n", "\r"), array("", ""), trim(implode(' :: ', $tmp)));
    With the following:
    PHP Code:

    ############################################
    # Title Tag Hack By RocketMarketingInc.com #
    ############################################
    $title '';
    $titlePartCount count($tmp);
    $icount 1;
    foreach(
    $tmp as $titlePart)
    {
     if(
    $icount!=1) { $title .= ($icount!=$titlePartCount) ? ' - ' ' | '; }
     
    $title .= $titlePart;
     
    $icount++;
    }
    $title str_replace(array("\n""\r"), array(""""), trim($title)); 

That should do it! If you have any questions let me know.
And if you need any other help with SEO on your site feel free to contact me at RocketMarketingInc.com or the contact link in my sig.

balinor 04-18-2010 03:55 AM

Re: Here is How to Change Page Title Tag Format (remove "::")
 
Nice! Been meaning to tackle this one eventually as it has been driving me nuts as well. Thanks for sharing, moving this to the Custom Mods forum.

hoosierglass 04-18-2010 08:01 AM

Re: Here is How to Change Page Title Tag Format (remove "::")
 
I believe this is not needed when using CDSEO Pro.

balinor 04-18-2010 08:36 AM

Re: Here is How to Change Page Title Tag Format (remove "::")
 
It is for some pages not covered by CDSEO Pro

gallaghersean 04-18-2010 10:40 AM

Re: Here is How to Change Page Title Tag Format (remove "::")
 
It's also good for those of us not using CDSEO Pro.

Paulw 04-29-2010 05:53 AM

Re: Here is How to Change Page Title Tag Format (remove "::")
 
Any idea's how to do this on 4.1.9 as include/templater/plugins/function.get_title.php doesn't exist?

Great mod by the way!

Paul

balinor 04-29-2010 06:10 AM

Re: Here is How to Change Page Title Tag Format (remove "::")
 
In 4.1.9 just edit customer/home.tpl. You'll see the title tag up top.

Paulw 04-29-2010 06:11 AM

Re: Here is How to Change Page Title Tag Format (remove "::")
 
I'm so thick! Many thanks

Paul

jvannghi 07-18-2010 02:33 PM

Re: Here is How to Change Page Title Tag Format (remove "::")
 
Any idea on how to remove the "::" and replace with "-" on X-Cart version 4.1.5? Thanks.

-John

ADDISON 07-19-2010 02:46 PM

Re: Here is How to Change Page Title Tag Format (remove "::")
 
It could be inserted in General Settings. A text box for that divider.

I will suggested in 4.4


All times are GMT -8. The time now is 04:36 AM.

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