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

page title info in 4.4.x

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 10-22-2010, 09:48 AM
 
upupcreative upupcreative is offline
 

Advanced Member
  
Join Date: Aug 2010
Posts: 66
 

Default page title info in 4.4.x

Hello. I've noticed that in my 4.4.x shop and others I've seen so far, they all have the same default page title (Home) as opposed to having the shop name as the default. I've tried service_head.tpl and the language labels and a few other things but I can't seem to figure out where this "home" label is coming from and how I can switch it to my shop name.

See http://www.upupcreative.com/product.php?productid=190485&cat=403&page=1 for example, where the page title SHOULD be Up Up Creative :: This Month's Picks :: 2011 Illustrated (etc...)

Thanks,
Julie
__________________
Version 4.4.2
Reply With Quote
  #2  
Old 10-22-2010, 09:50 AM
 
PhilJ PhilJ is offline
 

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

Default Re: page title info in 4.4.x

Try General Settings > SEO
__________________
xcartmods.co.uk
Reply With Quote
  #3  
Old 10-22-2010, 09:53 AM
 
upupcreative upupcreative is offline
 

Advanced Member
  
Join Date: Aug 2010
Posts: 66
 

Default Re: page title info in 4.4.x

I did try that also and it sort of worked. If I enter Up Up Creative as my default "title" tag on the SEO settings page you directed me to, it replaces everything from service_head.tpl so that every single page just has Up Up Creative without any additional category or product title info.
__________________
Version 4.4.2
Reply With Quote
  #4  
Old 10-22-2010, 06:58 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,191
 

Default Re: page title info in 4.4.x

Isn't it fun that QT still can't get the SEO right
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #5  
Old 10-23-2010, 01:12 PM
 
james elliott james elliott is offline
 

Member
  
Join Date: Jul 2008
Posts: 16
 

Default Re: page title info in 4.4.x

It would be great if someone could answer this? SEO in the cart's admin is crap if you use a site title the title is all that shows no products at all anyone?
__________________
james elliott
x-cart 4.5
Reply With Quote
  #6  
Old 10-25-2010, 09:51 AM
 
upupcreative upupcreative is offline
 

Advanced Member
  
Join Date: Aug 2010
Posts: 66
 

Default Re: page title info in 4.4.x

someone at QT let me know that this bug is being fixed. not sure when but at least it's coming...
__________________
Version 4.4.2
Reply With Quote
  #7  
Old 10-25-2010, 12:39 PM
 
peddler peddler is offline
 

Senior Member
  
Join Date: May 2007
Posts: 140
 

Default Re: page title info in 4.4.x

The "Home" field is set deep within the php files and prolly shouldn't be changed. It may have implications in other functions, like the clean url function. While waiting for xcart to get out a patch..

A small change can be made to the function.get_title.php file in the /include/templater/plugins/ directory and "Home" will turn into your domain name. At line #120 is this:


Code:
// truncate $title = str_replace(" ", " ", $title); if (strlen($title) > $config['SEO']['page_title_limit'] && $config['SEO']['page_title_limit'] > 0) { $title = func_truncate($title, $config['SEO']['page_title_limit']); }


Insert this after the first line of code:

Code:
// title mod $title = str_replace("Home", "Your Domain Name", $title); // end title mod


Thus:

Code:
// truncate $title = str_replace(" ", " ", $title); // title mod $title = str_replace("Home", "Your Domain Name", $title); // end title mod if (strlen($title) > $config['SEO']['page_title_limit'] && $config['SEO']['page_title_limit'] > 0) { $title = func_truncate($title, $config['SEO']['page_title_limit']); }

You can put whatever text you want in place of "Your Domain Name". e.g. "The Donut Hole - the hole truth and nothing but!" But it will show as part of the title on EVERY page!

===============

The line of code immediately above the "//truncate" comment is this:

Code:
$title = str_replace(array("\n", "\r"), array('', ''), trim(implode(' :: ', $tmp)));

That is what sets the separator between categories and "Home" (which will now have your domain name title!). That ' :: ' has the two colons (whaaat?), with a blank space on each side. You can change it to a hyphen, with or without a space on the sides.
__________________
Ralph
X-Cart v4.4.2 Gold (still buggy, some are new ones)
PHP 5.2.13
Reply With Quote

The following 2 users thank peddler for this useful post:
chamberinternet (04-08-2011), upupcreative (10-29-2010)
  #8  
Old 10-25-2010, 01:26 PM
 
peddler peddler is offline
 

Senior Member
  
Join Date: May 2007
Posts: 140
 

Default Re: page title info in 4.4.x

A little more complicated...

I set the title and meta data on the admin page (or in the import file) for all of my categories, products and static pages. This took care of all the pages that I use (don't use manufacturer) except for some of the help pages, cart pages and other buyer account pages. So I came up with a mod for them. Then I realized that the mod took care of the category, product and static page titles as I'd input them.. individually, painstakingly, input each and every one within the import file or admin page. Oh well

What the mod does: it strips out any string of categories or help zone layers so that only the last one is in the title, with the domain name first. Supposedly this is good for SEO - short and sweet. These:

Home :: Help Zone :: Contact Us
Home :: Profile Details :: Checkout
Home :: Large Widgets :: Red Widgets :: Older Widgets :: Refurbed Widgets
Home :: Large Widgets :: Red Widgets :: Older Widgets :: Refurbed Widgets :: Widget 228

Become these:

YourDomainName - Contact Us
YourDomainName - Checkout
YourDomainName - Refurbed Widgets
YourDomainName - Widget 228

Large segments of code are shown below (for reference), but only the bolded parts need be exchanged. And be sure to use your actual domain name in place of "Your Domain Name".

Original code (from function.get_title.php file, about line 120~):

Code:
// Title based on bread crumbs $location = $smarty->_tpl_vars['location']; $tmp = array(); if ($config['SEO']['page_title_format'] != 'A') $location = array_reverse($location); foreach ($location as $v) { $tmp[] = $v[0]; } $title = str_replace(array("\n", "\r"), array('', ''), trim(implode(' :: ', $tmp))); } // truncate $title = str_replace(" ", " ", $title); if (strlen($title) > $config['SEO']['page_title_limit'] && $config['SEO']['page_title_limit'] > 0) { $title = func_truncate($title, $config['SEO']['page_title_limit']); } // escape

Modded code:

Code:
// Title based on bread crumbs $location = $smarty->_tpl_vars['location']; $tmp = array(); if ($config['SEO']['page_title_format'] != 'A') $location = array_reverse($location); foreach ($location as $v) { $tmp[] = $v[0]; } $title = end($tmp); // truncate $title = str_replace(" ", " ", $title); if ($title == 'Home') { $title = str_replace("Home", "Your Domain Name", $title); } else { $title = 'Your Domain Name - ' . trim($title); } } if (strlen($title) > $config['SEO']['page_title_limit'] && $config['SEO']['page_title_limit'] > 0) { $title = func_truncate($title, $config['SEO']['page_title_limit']); } // escape


Or you can wait on the xcart patch and hope for the best. This one I don't want nor need, but a patch for OPC and the address book.. now THAT I need!
__________________
Ralph
X-Cart v4.4.2 Gold (still buggy, some are new ones)
PHP 5.2.13
Reply With Quote
  #9  
Old 10-25-2010, 04:41 PM
 
james elliott james elliott is offline
 

Member
  
Join Date: Jul 2008
Posts: 16
 

Default Re: page title info in 4.4.x

You the man , worked for me far as I can tell. X-cart needs to give you a job since they can't seem to figure it out..lol
__________________
james elliott
x-cart 4.5
Reply With Quote
  #10  
Old 10-29-2010, 04:59 PM
 
upupcreative upupcreative is offline
 

Advanced Member
  
Join Date: Aug 2010
Posts: 66
 

Default Re: page title info in 4.4.x

I haven't gotten to your second mod, Peddler, but the first one was so nice and quick and easy. I appreciate your help - that's exactly what I needed.

Julie
__________________
Version 4.4.2
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 07:34 PM.

   

 
X-Cart forums © 2001-2020