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 side menus on different pages (https://forum.x-cart.com/showthread.php?t=10164)

cotc2001 11-02-2004 11:55 AM

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

Jon 11-02-2004 12:14 PM

You have to use conditionals in your home.tpl

cotc2001 11-02-2004 12:23 PM

cheers jon, you couldnt give me an example to follow could you?

Jon 11-02-2004 01:37 PM

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}


cotc2001 11-02-2004 01:47 PM

Ok gotcha, i'll give it a go in the mornin

cotc2001 11-03-2004 12:54 AM

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}


Jon 11-03-2004 10:05 AM

Code:

{if $main ne "product" AND $main ne "catalog"}
{ include file="cartmods/testimonials/testimonials.tpl"}
 
{/if}

[/code]


All times are GMT -8. The time now is 04:57 PM.

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