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

different side menus on different pages

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-02-2004, 11:55 AM
 
cotc2001 cotc2001 is offline
 

X-Man
  
Join Date: Feb 2003
Location: Shrewsbury, UK
Posts: 2,351
 

Default different side menus on different pages

Is it possible to have different side menus (like bestseller, login etc.) depending on what page you are at.

i.e if im at product.tpl , i can show recommended other products but I dont want to display the news box.

They all seem to be controlled from the home.tpl but not sure how to control them from other pages.

x-cart 4.0.5
__________________
x-cart 4.0.5 (live and heavily modded)
Server: freebsd
Reply With Quote
  #2  
Old 11-02-2004, 12:14 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

You have to use conditionals in your home.tpl
Reply With Quote
  #3  
Old 11-02-2004, 12:23 PM
 
cotc2001 cotc2001 is offline
 

X-Man
  
Join Date: Feb 2003
Location: Shrewsbury, UK
Posts: 2,351
 

Default

cheers jon, you couldnt give me an example to follow could you?
__________________
x-cart 4.0.5 (live and heavily modded)
Server: freebsd
Reply With Quote
  #4  
Old 11-02-2004, 01:37 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

Open up your skin1/customer/home_main.tpl

You'll see a wack of conditionals using the $main variable. You could implement similar things in home.tpl

For example:

Code:
{if $main eq "register"} We know we are on the register page {/if} {if $main eq "product"} We know we are on a product page {/if} {if $main eq "catalog"} We know we are viewing a category {/if}
Reply With Quote
  #5  
Old 11-02-2004, 01:47 PM
 
cotc2001 cotc2001 is offline
 

X-Man
  
Join Date: Feb 2003
Location: Shrewsbury, UK
Posts: 2,351
 

Default

Ok gotcha, i'll give it a go in the mornin
__________________
x-cart 4.0.5 (live and heavily modded)
Server: freebsd
Reply With Quote
  #6  
Old 11-03-2004, 12:54 AM
 
cotc2001 cotc2001 is offline
 

X-Man
  
Join Date: Feb 2003
Location: Shrewsbury, UK
Posts: 2,351
 

Default

Ok cheers Jon,

But what happens if you want it on several pages but not on some

can I use & (yes i know I should really read up on smarty)

for example i want to hide the news.tpl on just the product and products tpls

could I use

Code:
{if $main ne "product" & "products"} { include file="cartmods/testimonials/testimonials.tpl"} {/if}
__________________
x-cart 4.0.5 (live and heavily modded)
Server: freebsd
Reply With Quote
  #7  
Old 11-03-2004, 10:05 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

Code:
{if $main ne "product" AND $main ne "catalog"} { include file="cartmods/testimonials/testimonials.tpl"} {/if}
[/code]
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 04:30 AM.

   

 
X-Cart forums © 2001-2020