View Single Post
  #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