X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Different head.tpl for each category (https://forum.x-cart.com/showthread.php?t=4926)

tpfair 10-24-2003 05:26 AM

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

vickys_box 10-24-2003 08:22 AM

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.

tpfair 10-24-2003 08:41 AM

Category - Head
 
Hello,


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



Stefan

nlindahl 10-24-2003 01:37 PM

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.


All times are GMT -8. The time now is 07:24 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.