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

How to Change the X-cart title code...

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 06-22-2005, 12:11 PM
 
sbtiti sbtiti is offline
 

Advanced Member
  
Join Date: Feb 2005
Posts: 32
 

Default 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> {if $config.SEO.page_title_format eq "A"} {section name=position loop=$location} {$location[position].0|escape} {if not %position.last%} :: {/if} {/section} {else} {section name=position loop=$location step=-1} {$location[position].0|escape} {if not %position.last%} :: {/if} {/section} {/if} </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!
__________________
Version 4.0.9
Reply With Quote
  #2  
Old 06-22-2005, 02:10 PM
 
Bella Forma Bella Forma is offline
 

Senior Member
  
Join Date: Nov 2004
Location: Australia
Posts: 150
 

Default

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:

{strip}<TITLE>
{if $config.SEO.page_title_format eq "A"}
{strip}{section name=position loop=$location}
{$location[position].0|escape}
{if not %position.last%} - {/if}
{/section}{/strip}
{else}
{strip}{section name=position loop=$location step=-1}
{$location[position].0|escape}
{if not %position.last%} - {/if}
{/section}
{$lng.lbl_seo_title}{/strip}
{/if}
</TITLE>{/strip}
__________________
X-Cart Gold 4.0.12
X-AOM, X-RMA, X-FancyCat
Apache/Linux Server
PHP 4.3.8
Reply With Quote
  #3  
Old 06-27-2005, 09:16 AM
 
sbtiti sbtiti is offline
 

Advanced Member
  
Join Date: Feb 2005
Posts: 32
 

Default

How do I create a "language variable"?
__________________
Version 4.0.9
Reply With Quote
  #4  
Old 06-27-2005, 09:32 AM
 
hooter hooter is offline
 

X-Adept
  
Join Date: Dec 2004
Posts: 519
 

Default

Quote:
Originally Posted by sbtiti
How do I create a "language variable"?

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
__________________
Blog for X-Cart | Ebay Auction Manager
Reply With Quote
  #5  
Old 06-27-2005, 11:08 AM
 
sbtiti sbtiti is offline
 

Advanced Member
  
Join Date: Feb 2005
Posts: 32
 

Default

Didn't work. Created the "language variable" called "lbl_seo_title" with the slogan and put this into the home.tpl:

Code:
{strip}<TITLE> {if $config.SEO.page_title_format eq "A"} {strip}{section name=position loop=$location} {$location[position].0|escape} {if not %position.last%} - {/if} {/section}{/strip} {else} {strip}{section name=position loop=$location step=-1} {$location[position].0|escape} {if not %position.last%} - {/if} {/section} {$lng.lbl_seo_title}{/strip} {/if} </TITLE>{/strip}

but it didn't show any slogan in any of the titles.
__________________
Version 4.0.9
Reply With Quote
  #6  
Old 06-27-2005, 01:47 PM
 
Bella Forma Bella Forma is offline
 

Senior Member
  
Join Date: Nov 2004
Location: Australia
Posts: 150
 

Default

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.
__________________
X-Cart Gold 4.0.12
X-AOM, X-RMA, X-FancyCat
Apache/Linux Server
PHP 4.3.8
Reply With Quote
  #7  
Old 06-29-2005, 11:45 AM
 
sbtiti sbtiti is offline
 

Advanced Member
  
Join Date: Feb 2005
Posts: 32
 

Default

OK I tried it again and here's what I did / happened:

Here's my original code:

Code:
<TITLE> {if $config.SEO.page_title_format eq "A"} {section name=position loop=$location} {$location[position].0|escape} {if not %position.last%} :: {/if} {/section} {else} {section name=position loop=$location step=-1} {$location[position].0|escape} {if not %position.last%} :: {/if} {/section} {/if} </TITLE>

As per your instructions I added the line:

Code:
{$lng.lbl_seo_title}{/strip}
after the section code and I added the strip code after the /title code so that it ended up looking like this:

Code:
<TITLE> {if $config.SEO.page_title_format eq "A"} {section name=position loop=$location} {$location[position].0|escape} {if not %position.last%} :: {/if} {/section} {else} {section name=position loop=$location step=-1} {$location[position].0|escape} {if not %position.last%} :: {/if} {/section} {$lng.lbl_seo_title}{/strip} {/if} </TITLE>{/strip}

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?
__________________
Version 4.0.9
Reply With Quote
  #8  
Old 07-05-2005, 05:16 PM
 
Bella Forma Bella Forma is offline
 

Senior Member
  
Join Date: Nov 2004
Location: Australia
Posts: 150
 

Default

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.
__________________
X-Cart Gold 4.0.12
X-AOM, X-RMA, X-FancyCat
Apache/Linux Server
PHP 4.3.8
Reply With Quote
  #9  
Old 07-08-2005, 02:01 PM
  GriffithLea's Avatar 
GriffithLea GriffithLea is offline
 

Member
  
Join Date: Jun 2005
Location: Houston, TX
Posts: 28
 

Default

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.
__________________
Started out with Version 4.0.13 .
Upgraded to Version 4.0.14 on 27 Jun 2005 .
Upgraded to Version 4.0.17 on 04 Dec 2005 .
Upgraded to Version 4.0.19 on 24 Oct 2006 .
Reply With Quote
  #10  
Old 07-08-2005, 07:08 PM
 
Bella Forma Bella Forma is offline
 

Senior Member
  
Join Date: Nov 2004
Location: Australia
Posts: 150
 

Default

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
__________________
X-Cart Gold 4.0.12
X-AOM, X-RMA, X-FancyCat
Apache/Linux Server
PHP 4.3.8
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 09:28 AM.

   

 
X-Cart forums © 2001-2020