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

extra_field value in page title?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-13-2010, 06:41 AM
 
retrtrtrytrutru retrtrtrytrutru is offline
 

Senior Member
  
Join Date: Aug 2007
Posts: 101
 

Default extra_field value in page title?

Hi everyone,

Is it possible to include the data from extra_field into the page's title? We have some important SEO words entered in the extra_field under each product and it would be great if we could show these values in the page title as well. Using X-Cart v4.2.0.

Thanks in advance for any tips!
__________________
www.qualitylamps.eu
X-Cart Gold 4.1.8, PHP 5.2.6, MySQL 5.0.51a, Apache 2.2.9

www.vervangjelamp.nl
X-Cart Gold 4.2.0, PHP 5.2.6, MySQL 5.0.37-standard, Apache/2

Sorry for the weird user name, I registered it by mistake
Reply With Quote
  #2  
Old 09-13-2010, 07:56 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: extra_field value in page title?

not sure with CDSEO. if you are using default xcart clean urls it should be a metter of editing the template that puts out the title
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #3  
Old 09-13-2010, 11:00 PM
 
retrtrtrytrutru retrtrtrytrutru is offline
 

Senior Member
  
Join Date: Aug 2007
Posts: 101
 

Default Re: extra_field value in page title?

Thank you for the input. All I can find is {$html_page_title|escape} in service_head.tpl. I have no idea how to edit this so that it will include the extra_field from the product page (in product.tpl I used {$extra_fields[2].field_value} to show the value on the product page).

Edit, after some playing around with some code from our old website I got it to work, somewhat. It's not perfect yet but it does display the extra_field. Only problem, it does it twice..

In service_head.tpl:

Code:
<title> {if $main eq "catalog" and $current_category.category eq ""}Vervang Je Lamp.nl {else}{strip}{capture name=title} {if $config.SEO.page_title_format eq "A"} {section name=position loop=$location} {if not %position.first%}&nbsp;-&nbsp;{/if} {$location[position].0|strip_tags|escape} {/section} {else} {section name=position loop=$location step=-1}{if not %position.first%}&nbsp;{$extra_fields[1].field_value}&nbsp;-&nbsp;{/if} {$location[position].0|strip_tags|escape} {/section} {/if} {/capture} {if $config.SEO.page_title_limit <= 0}{$smarty.capture.title}{else}{$smarty.capture.title|replace:"&nbsp;":" "|truncate:$config.SEO.page_title_limit|replace:" ":"&nbsp;"}{/if} {/strip} {/if} </title>

This outputs the following title in the product list pages:

PRODUCT EXTRA_FIELD_VALUE1 - CATEGORY EXTRA_FIELD_VALUE1 - COMPANYNAME

Any advice on how to prevent the extra_field value from being repeated? Thanks in advance
__________________
www.qualitylamps.eu
X-Cart Gold 4.1.8, PHP 5.2.6, MySQL 5.0.51a, Apache 2.2.9

www.vervangjelamp.nl
X-Cart Gold 4.2.0, PHP 5.2.6, MySQL 5.0.37-standard, Apache/2

Sorry for the weird user name, I registered it by mistake
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 03:50 PM.

   

 
X-Cart forums © 2001-2020