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

Different head.tpl for each category

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 10-24-2003, 05:26 AM
 
tpfair tpfair is offline
 

Advanced Member
  
Join Date: May 2003
Posts: 81
 

Default Different head.tpl for each category

Hello,


I would like to know how do i do to, when a customer choose a category to bring a head.tpl matching that category, i want to load a matching head.tpl for each main category.


Stefan
Reply With Quote
  #2  
Old 10-24-2003, 08:22 AM
 
vickys_box vickys_box is offline
 

Member
  
Join Date: Aug 2003
Posts: 17
 

Default

I would suggest that the easiest thing to do is to keep head.tpl, but replace its content with Smarty code that reads the $cat variable and then includes the appropriate file (be it .tpl or straight .html) depending on that value.
Reply With Quote
  #3  
Old 10-24-2003, 08:41 AM
 
tpfair tpfair is offline
 

Advanced Member
  
Join Date: May 2003
Posts: 81
 

Default Category - Head

Hello,


Great, but how do i do that , any example ???



Stefan
Reply With Quote
  #4  
Old 10-24-2003, 01:37 PM
  nlindahl's Avatar 
nlindahl nlindahl is offline
 

Member
  
Join Date: Aug 2003
Location: Edmonton, AB, Canada
Posts: 28
 

Default

You may want to start by reading the Smarty Docs for a decent idea of what you are capable of doing with a tpl file.

In head.tpl, you'll have the $cat variable available to you. You can use that with if/elseif statements to determine what category you are in and then use the smarty include statement to display the contents of another tpl file or html.

In a case like this all you would have in head.tpl would be a lot of if statements for each category followed by include statements. All output to the browser would be in the various files you include.
__________________
Nick
Running various versions of X-Cart Gold in various locations...
(when I have time, I\'ll make them all current, but by then x-cart 5.x.x will probably be out....)
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 10:33 PM.

   

 
X-Cart forums © 2001-2020