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

Here is How to Change Page Title Tag Format (remove "::")

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #21  
Old 08-12-2010, 09:08 AM
 
jvannghi jvannghi is offline
 

Member
  
Join Date: Mar 2008
Posts: 23
 

Default Re: Here is How to Change Page Title Tag Format (remove "::")

Quote:
Originally Posted by am2003
It could be inserted in General Settings. A text box for that divider.

I will suggested in 4.4

I'm sorry...don't quite understand. Can you clarify? I didn't see anything in general settings.
__________________
4.7.9
Reply With Quote
  #22  
Old 08-04-2011, 07:56 AM
 
ScottW ScottW is offline
 

Member
  
Join Date: Dec 2010
Posts: 11
 

Default Re: Here is How to Change Page Title Tag Format (remove "::")

FYI in version 4.4.2 the variable $tmp is replaced by the variable $title_items so you have to switch out the variable in the code to make it work in 4.4.2.
__________________
X-Cart Gold v4.4.2
X-Cart Pro v4.3.2
Reply With Quote
  #23  
Old 12-19-2011, 09:39 PM
 
kgoel kgoel is offline
 

Advanced Member
  
Join Date: May 2010
Posts: 82
 

Default Re: Here is How to Change Page Title Tag Format (remove "::")

Quote:
Originally Posted by Vacman
Likewise I can't get it to work for 4.3.2. I made the changes, cleared the cache, etc - and no difference.

Could you get it working for 4.3.2. I have tried the changes but no difference.
__________________
Version 4.3.2
Reply With Quote
  #24  
Old 10-18-2012, 09:59 AM
  gallaghersean's Avatar 
gallaghersean gallaghersean is offline
 

Advanced Member
  
Join Date: Aug 2008
Location: Clearwater, FL
Posts: 52
 

Default Re: Here is How to Change Page Title Tag Format (remove "::")

Here is an update on how to do this for v 4.5.x

There are 2 different methods. One for just making the :: to a dash (basic) and the other is having a dash between products & categories and pipe before site name (complex).

Before doing either make sure to backup your files that are being changed and to set your Page title format in the SEO settings (Main page :: General settings :: SEO) to Product name :: Category name :: Shop name.

Basic change of :: characters to dash (-):
  1. Open up the file include/templater/plugins/function.get_title.php
  2. Go to line 152 (or around that area).
  3. On this line you will find $title = str_replace(array("\n", "\r"), array('', ''), trim(implode(' :: ', $title_items))); at the end of the line of code change the :: out for the dash - character or whatever you want.
  4. Save and re-upload to server.
  5. Now this will make your title tags look like this Product Name - Category - Site Name
Complex change of :: characters to dash for products and pipe for site name:
  1. Open up the file include/templater/plugins/function.get_title.php
  2. Go to line 152 (or around that area).
  3. Remove the following line:
    $title = str_replace(array("\n", "\r"), array('', ''), trim(implode(' :: ', $title_items)));
  4. Replace that line with the following code.
    PHP Code:
    #######################################
    # Title Tag Hack By RocketRideSEO.com #
    #######################################
    $title '';
    $titlePartCount count($title_items);
    $icount 1;
    foreach(
    $title_items as $titlePart)
    {
     if(
    $icount!=1) { $title .= ($icount!=$titlePartCount) ? ' - ' ' | '; }
     
    $title .= $titlePart;
     
    $icount++;
    }
    $title str_replace(array("\n""\r"), array(""""), trim($title)); 
  5. Save and re-upload to server.
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 RocketRideSEO.com or the contact link in my signature.
__________________
.

Contact me about modifying x-cart for your needs.

Xcart Gold versions:
4.5.x, 4.4.3, 4.4.1, 4.4.0, 4.3.1
4.1.10, 4.1.9, 4.1.8

Add-on modules:

Featured Product Carousel
and other various mods I've built
Reply With Quote

The following 2 users thank gallaghersean for this useful post:
mcanitano (07-25-2014), Mish (12-09-2012)
  #25  
Old 11-18-2012, 10:18 AM
 
wplume wplume is offline
 

Member
  
Join Date: May 2005
Location: Missouri, USA
Posts: 29
 

Default Re: Here is How to Change Page Title Tag Format (remove "::")

Balinor,

My home.tpl doesn't have any code that looks like
"$title = str_replace(array("\n", "\r"), array("", ""), trim(implode(' :: ', $tmp)));

Has anyone done this on v4.1.9?

-Wayne
__________________
cnctech
v4.1.9
CDSEO Pro
Advanced Mini-Cart
AOM
Remember Me
Remember Anonymous Carts
BCS Fast Lane Shipping Estimator
BCS Order Page Emailer
BCS Authorize.net DPM
BCS Inventory Pricing
Checkout One
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 04:23 AM.

   

 
X-Cart forums © 2001-2020