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

Custom Category and Subcategory Menu Blocks

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #11  
Old 01-09-2006, 09:07 AM
  techdesign's Avatar 
techdesign techdesign is offline
 

Advanced Member
  
Join Date: May 2003
Posts: 30
 

Default

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?
__________________
X-Cart Gold 4.4.1
X-Cart Gold 4.2.3
Reply With Quote
  #12  
Old 02-06-2009, 11:00 AM
 
mudebate mudebate is offline
 

Advanced Member
  
Join Date: Jan 2009
Posts: 62
 

Default Re: Custom Category and Subcategory Menu Blocks

Can this code be modified to work based on the root category id?

Just curious
__________________
mudebate


X-cart 4.11 - One page checkout, category meta tags, manufacturer meta tags, a few others


X-cart 4.2, tabbed products menu



Reply With Quote
  #13  
Old 02-06-2009, 12:09 PM
 
mudebate mudebate is offline
 

Advanced Member
  
Join Date: Jan 2009
Posts: 62
 

Default 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


X-cart 4.11 - One page checkout, category meta tags, manufacturer meta tags, a few others


X-cart 4.2, tabbed products menu



Reply With Quote
  #14  
Old 02-06-2009, 01:18 PM
 
mudebate mudebate is offline
 

Advanced Member
  
Join Date: Jan 2009
Posts: 62
 

Default Re: Custom Category and Subcategory Menu Blocks

OK, figured it out:

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


X-cart 4.11 - One page checkout, category meta tags, manufacturer meta tags, a few others


X-cart 4.2, tabbed products menu



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

   

 
X-Cart forums © 2001-2020