| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Different head.tpl for each category | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() 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 |
|||||||
#2
|
|||||||
|
|||||||
![]() 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.
|
|||||||
#3
|
|||||||
|
|||||||
![]() Hello,
Great, but how do i do that , any example ??? Stefan |
|||||||
#4
|
|||||||||
|
|||||||||
![]() 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....) ![]() |
|||||||||
|
|||
X-Cart forums © 2001-2020
|