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)
-   -   Modifying Document Title on Homepage (https://forum.x-cart.com/showthread.php?t=43120)

shiehshieh 10-20-2008 02:13 PM

Modifying Document Title on Homepage
 
Sorry guys, I'm sure this is posted some where on this forum, but I just wasn't able to find it. How do I change the document title for the main home page?

Right now when you go to the our homepage, the document title is [Company Name]. But how do I modify this to include the keywords that I want? For example, [Company Name] - [keyword1], [keyword2], [keyword3]...

Thanks so much in advance.

JWait 10-21-2008 04:46 AM

Re: Modifying Document Title on Homepage
 
The short answer is it can't be done. There is a thread at http://forum.x-cart.com/showthread.php?t=23114 discussing this but so far no one has come up with a solution. The problem is, as long as 'lbl_site_title' remains empty, the Company name option value defined in the General settings/Company options section will be used as the site title instead of 'lbl_site_title'. If, however, you choose to assign a value to 'lbl_site_title', you will be able have different values for your company name and site title, but lbl_site_title will be shown on every page on your site at the beginning of the breadcrumb trail.

balinor 10-21-2008 04:52 AM

Re: Modifying Document Title on Homepage
 
Not true at all. In customer/home.tpl, replace this:

Code:

<title>{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;::&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}</title>


with this:

Code:

<title>
{if $main eq "catalog" and $current_category.category eq ""}
Insert your keyword-rich title here
{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;::&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>


JWait 10-21-2008 05:32 AM

Re: Modifying Document Title on Homepage
 
I can't believe it was that easy. I have been looking for how to do this for about 4 years, and there are numerous threads on the same subject. Thanks Padraic!

shan 10-22-2008 02:52 AM

Re: Modifying Document Title on Homepage
 
I generaly set a config variable or language variable up for this and make the same adjustment

JWait 10-22-2008 04:01 AM

Re: Modifying Document Title on Homepage
 
This should be in questions asked a million times. As I said, it is something I have spent years looking for, and have asked about several times. There are numerous threads scatter around the forum and this is the first time anyone had the solution.

balinor 10-22-2008 04:08 AM

Re: Modifying Document Title on Homepage
 
Will do

joyla 10-28-2008 02:05 PM

Re: Modifying Document Title on Homepage
 
Watch Out !
Not replac e but replace!

I copied this passage to home.tpl and got a smarty debug error
Our webshopping mall didn't work for short time until I found this error.
But anyway, I appreciate for excellent Mr.Bailor's advice to solve problem
to change the title of main page.

I hope Nobody experience same situation like me after posting this quote!
Thanks Everybody!!

balinor 10-28-2008 02:19 PM

Re: Modifying Document Title on Homepage
 
Huh?

espresso 11-14-2008 09:08 AM

Re: Modifying Document Title on Homepage
 
Balinor, just brilliant :-) Thank you.


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

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