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)
-   -   Custom Category and Subcategory Menu Blocks (https://forum.x-cart.com/showthread.php?t=19040)

techdesign 01-09-2006 09:07 AM

Well we were close. Here is what works:

Code:

{if $location[1].0 eq "Livestock" }
{ include file="customer/menu_livestock.tpl" }
{elseif $location[1].0 eq "Horse"}
{ include file="customer/menu_horse.tpl" }
{elseif $location[1].0 eq "Pet"}
{ include file="customer/menu_pet.tpl" }
{/if}



I am wanting to take it one step further and include certain pages also. For example:

Code:

{if $location[1].0 eq "Livestock" or $smarty.get.pageid eq '1'}
{ include file="customer/menu_livestock.tpl" }
...


Which works, but I want to add mutiple pages. Like pageid 1,3,4,6,7,8 for the first section and 9, 10, 13, 14, etc for second section and so on and so forth. I'm not sure how to add the multiple pages without having to do them each separate. Like this -

Code:

{if $location[1].0 eq "Livestock" or $smarty.get.pageid eq '1' or $smarty.get.pageid eq '3' or $smarty.get.pageid eq '4' or $smarty.get.pageid eq '6' ....

This would get fairly messy. I'm looking for something more like this -
Code:

{if $location[1].0 eq "Livestock" or $smarty.get.pageid eq '1,3,4,6,7,8'}
{ include file="customer/menu_livestock.tpl" }
...

But I don't have a clue how to get 'er done.

Ideas?

mudebate 02-06-2009 11:00 AM

Re: Custom Category and Subcategory Menu Blocks
 
Can this code be modified to work based on the root category id?

Just curious

mudebate 02-06-2009 12:09 PM

Re: Custom Category and Subcategory Menu Blocks
 
Also, let's say I want to display .tpl file only on the product page for a specific product. Could something like this be written that would do this?

Ie.
{if product id eq 1}
{include customer/abd.tpl}
{/if}

Thanks for the help!

mudebate 02-06-2009 01:18 PM

Re: Custom Category and Subcategory Menu Blocks
 
OK, figured it out:

{if $product.productid eq '47'}
{include file="yourfilename.tpl"}
{/if}


All times are GMT -8. The time now is 12:26 AM.

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