X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   extra_field value in page title? (https://forum.x-cart.com/showthread.php?t=55506)

retrtrtrytrutru 09-13-2010 06:41 AM

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!

cflsystems 09-13-2010 07:56 AM

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

retrtrtrytrutru 09-13-2010 11:00 PM

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 :)


All times are GMT -8. The time now is 06:52 PM.

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