![]() |
How to Change the X-cart title code...
Without it changing other aspects of my cart?
I tried adding it directly into the "Company name" field, but then it appears on the navigation tree and probably other places that I didn't notice. I want to add a slogan after the domain name so it looks like this: domain.com - slogan and when viewing the product pages or any other Xcart page that places text after the domain I want the slogan to be in there right after the domain. I tried playing with this code in home.tpl: Code:
<TITLE> but it never would put it in the right spot or it would appear twice. How do I get my slogan to appear after the domain name, but still include the default category and product title code after the slogan on those pages, while only the domain name and slogan appear on home.php? Can somebody please help? Thanks! |
I set up a language variable called $lng.lbl_seo_title which I put my slogan in.
Then put it right after the last {/section} like this: Quote:
|
How do I create a "language variable"?
|
Quote:
Xcart Administration -> Languages -> Edit Language (select your default language from pulldown) -> Select topic (Label, Text, E-mail, Errors, Languages, Countries) -> Add your own variable using the text input boxes below "Add new entry" -> Apply changes |
Didn't work. Created the "language variable" called "lbl_seo_title" with the slogan and put this into the home.tpl:
Code:
{strip}<TITLE> but it didn't show any slogan in any of the titles. |
Hmmm strange definately works for me and I can't remember making any other changes. Only difference is your on a different version but the original code looks exactly the same as mine.
Did you navigate further into the store than the home page? The home page title will still be controled by the index.html page but once you get past that the lbl_seo_title takes over. I set my language variable up as a Label. No idea if this makes a difference (I wouldn't have thought so) but worth checking and changing if your is different. |
OK I tried it again and here's what I did / happened:
Here's my original code: Code:
<TITLE> As per your instructions I added the line: Code:
{$lng.lbl_seo_title}{/strip} Code:
<TITLE> It looks like my code differs from yours slightly, I don't have the strip code before the title and a few other smaller things. Here's the error I get when using that code: Code:
Fatal error: Smarty error: [in customer/home.tpl line 19]: syntax error: mismatched tag {/strip}. expected {/else} (opened line 14). (Smarty_Compiler.class.php, li in /home/gmgadmin/public_html/cart/Smarty-2.6.3/Smarty.class.php on line 1082 If I remove the two strip codes then the frontpage (home.php) finally came up, but there is no slogan appearing in the browser title on home.php or any other page. I did recreate the langauge entry as a label before all of this. Do you have any more ideas of how I can get this to work? |
Sorry only just come back to this post. Did you finally get it working?
If not the error message is telling you that you need to place the strip code before the title (as well as after) Remember commands like that always come in pairs so if you miss an opening or closing tag from the pair then you will get a 'mismatch' type error. |
Hi, this mod interests me, as I too want to append a phrase to the Company Name (i.e. that which is specified in General Settings -> Company Options) but only in the TITLE section of the HTML source. Is that what your mod does? Can you give me a quick explanation of how it works, so I can be sure that it's what I want before I implement it? I'd really appreciate it.
|
Yes that's exactly what this mod does. Easiest way to see what it does is to implement it as it's a very minor mod and easily changed back if you don't like it.
I can't claim any credit for it though, it was something I picked up from another post on these forums: http://forum.x-cart.com/viewtopic.php?t=9907&highlight=title+strip |
All times are GMT -8. The time now is 12:07 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.