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

Custom Title Code

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 04-27-2006, 02:26 PM
 
bridal-land bridal-land is offline
 

Advanced Member
  
Join Date: Feb 2006
Posts: 38
 

Default Custom Title Code

Ok Im really new to all of this but I did finally get something to work the way that I wanted it to so im very excited

This is the title code to my site.
This will let you have a custom title for your main home page, another for your static pages, it will pull from lng.txt for help, cart, checkout, gift cert, order mess and thank you. and it will pull breadcrumbs in reverse order for all catagories and product so that the best keyword is first.

This was exactly what I was looking for and I hope that maybe someone else may save some time with this.


Code:
<TITLE> {if $main eq "catalog" and $current_category.category eq ""} Personalized Ribbons | Printed Ribbon | Napkins | & More {section name=position loop=$location step=-1} {math equation="x-1" x=$smarty.section.position.total assign="secondlast"} {if $smarty.section.position.iteration ne $smarty.section.position.total}{$location[position].0|escape}{/if} {if $smarty.section.position.iteration ne $secondlast}{if not %position.last%} {/if} {/if} {/section} {elseif $main eq "help"} {$lng.txt_subtitle_help} {elseif $main eq "cart"} {$lng.txt_subtitle_cart} {elseif $main eq "checkout"} {$lng.txt_subtitle_checkout} {elseif $main eq "order_message"} {$lng.txt_subtitle_thankyou} {elseif $main eq "wishlist"} {$lng.txt_subtitle_wishlist} {elseif $main eq "giftcert"} {$lng.txt_subtitle_giftcerts} {elseif $main eq "pages"} Quality wedding products for Brides & Grooms at affordable prices - Bridal Land {else} {section name=position loop=$location step=-1}{$location[position].0|escape}{if not %position.last%} :: {/if}{/section}{/if}</TITLE>
__________________
Mike
X-Cart 4.0.18
http://www.bridal-land.com
Reply With Quote
  #2  
Old 04-27-2006, 02:28 PM
 
bridal-land bridal-land is offline
 

Advanced Member
  
Join Date: Feb 2006
Posts: 38
 

Default

I probably should have added that this works in 3.5.12 Im not sure if it will work in anyother version.
__________________
Mike
X-Cart 4.0.18
http://www.bridal-land.com
Reply With Quote
  #3  
Old 06-15-2006, 12:05 PM
 
crunch42 crunch42 is offline
 

Member
  
Join Date: Jan 2006
Posts: 28
 

Default

It seems to work very well in 4.0.17 (once I figured out to change the reference to brides, grooms, and ribbons!). Thanks for this.
__________________
Version 4.0.17
Crunch42 Web Design
Reply With Quote
  #4  
Old 06-16-2006, 07:04 AM
 
Corto_Maltese Corto_Maltese is offline
 

Advanced Member
  
Join Date: Apr 2006
Location: Canada
Posts: 33
 

Default

Well : where do you put these lines ? Which tpl or php file ?
Thanks
__________________
X-Cart 4.0.18
Telafirma Mod - Bcse Mods
Ruby Mod - Firetank Mods
Reply With Quote
  #5  
Old 06-16-2006, 09:44 AM
 
crunch42 crunch42 is offline
 

Member
  
Join Date: Jan 2006
Posts: 28
 

Default

skin1/customer/home.tpl starting at line 8, at least in my version.
__________________
Version 4.0.17
Crunch42 Web Design
Reply With Quote
  #6  
Old 07-11-2006, 01:46 PM
 
MCM MCM is offline
 

Senior Member
  
Join Date: Dec 2005
Posts: 114
 

Default

Is there any way to pull in the actual title for static pages? This is a great mod, and that would make it even better... perhaps something like:

Static Page Name - Store Name

This would enable the individual pages to get better indexed.

Another minor note is that it's been suggested to use "-" instead of "::" because search engines don't like the non-standard characters... take your pick
__________________
Version 4.0.17/4.0.18
Reply With Quote
  #7  
Old 07-11-2006, 01:56 PM
 
MCM MCM is offline
 

Senior Member
  
Join Date: Dec 2005
Posts: 114
 

Default

Wait, I got it! This will display the title given to each static page:

Code:
<TITLE> {if $main eq "catalog" and $current_category.category eq ""} High-Grade Modern Gold, Silver, and Platinum Coinage! American Eagles and Commemoratives - Modern Coin Mart {section name=position loop=$location step=-1} {math equation="x-1" x=$smarty.section.position.total assign="secondlast"} {if $smarty.section.position.iteration ne $smarty.section.position.total}{$location[position].0|escape}{/if} {if $smarty.section.position.iteration ne $secondlast}{if not %position.last%} {/if} {/if} {/section} {elseif $main eq "help"} {$lng.txt_subtitle_help} {elseif $main eq "cart"} {$lng.txt_subtitle_cart} {elseif $main eq "checkout"} {$lng.txt_subtitle_checkout} {elseif $main eq "order_message"} {$lng.txt_subtitle_thankyou} {elseif $main eq "wishlist"} {$lng.txt_subtitle_wishlist} {elseif $main eq "giftcert"} {$lng.txt_subtitle_giftcerts} {elseif $main eq "pages"} {$page_data.title } - High-Grade Modern Coins - Modern Coin Mart {else} {section name=position loop=$location step=-1}{$location[position].0|escape}{if not %position.last%} - {/if}{/section}{/if}</TITLE>
__________________
Version 4.0.17/4.0.18
Reply With Quote
  #8  
Old 11-09-2006, 04:53 AM
 
pnm pnm is offline
 

Advanced Member
  
Join Date: Jun 2006
Posts: 99
 

Default Re: Custom Title Code

Mike,

I'm fairly new at this and am looking for a template, like your site, was it from a template or customised?
__________________
version 4.018 xcart
Reply With Quote
  #9  
Old 06-27-2007, 08:13 AM
 
rmoore rmoore is offline
 

Member
  
Join Date: Jun 2007
Posts: 18
 

Default Re: Custom Title Code

MCM,

Nice Mod...... Thank you!
__________________
Webmaster
Mosaic Networks

X-Cart version 4.1.3
PHP 5.2.0
MySQL server 4.1.12
Web server Apache
OS Linux
Reply With Quote
  #10  
Old 07-12-2007, 07:55 AM
 
keystone keystone is offline
 

X-Adept
  
Join Date: Jul 2006
Location: USA
Posts: 787
 

Default Re: Custom Title Code

does anyone know if this mod will work with version 4.1.8? and do I replace the code already between the title tags with this code or just add it right after <title>{strip}?
Thanks
__________________
www.uscandleco.com - X-Cart Version 4.7.11 Gold Plus php7.3
mods:
reCaptcha
running on UNIX

www.keystonecandle.com X-Cart Gold Plus - Version 4.7.11 php7.2
mods:
reCaptcha
cdseo pro
running on UNIX
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 02:23 PM.

   

 
X-Cart forums © 2001-2020