| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Hiding and showing elements on different pages | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Hiding and showing elements on different pages
Hello all, my first time using xcart so please go easy, I used to work with Actinic ecommerce software but got sick and tired of it.
Getting used to the structure and how the store works. Im throwing myself in at the deep end and creating a fresh template. One of the things I want to do is hide or show various elements depending on what page the user is on. Im aware that this can be done and have achieved it on some items, but for this one im stuck >> In content.tpl I have created a space which will hold a rotating / fading jquery slider, this needs to appear as default apart from various pages, these being: cart stuff product pages category pages On the category pages only, I want to replace this div with another which holds the current category image. I have found out how to do this: http://forum.x-cart.com/showthread.php?t=54046 Being a designer and not being a programmer (having a head that works that way) im guessing at what I need. So far I have got the following which show the category images: <div id="banner"> <img src="{if $current_category.icon_url}{$current_category.icon _url} {else}{$xcart_web_dir}/image.php?id={$cat}&type=C{/if}" alt="Home & Garden" /> </div><!-- / banner --> How do I hide this on every other page, but show the other div as default apart from the cart stuff and product pages? I have got this far for the hiding on the product and cart page. Ive tried to find something which would allow hiding on the categories but haven't been able to. {if ($main neq 'product' and $main neq 'cart' or $cart_empty) and $main neq 'checkout'} <div id="banner"> jquery slider </div><!-- / banner --> {/if} If's and else's direction needed please. Thanks in advance. Kon
__________________
------------------------------------------------ Darren |
|||||||
#2
|
|||||||||
|
|||||||||
Re: Hiding and showing elements on different pages
Category pages you'd need:
$main neq "catalog"
__________________
Paul Dodman e-business & m-commerce consultant w: www.luminointernet.com e: xcart@luminointernet.com Professional X-Cart help, advice, support and services, specialists in Mobile X-Cart. |
|||||||||
#3
|
|||||||
|
|||||||
Re: Hiding and showing elements on different pages
Thanks for the reply Paul, that hides it on the home page too though
__________________
------------------------------------------------ Darren |
|||||||
#4
|
|||||||
|
|||||||
Re: Hiding and showing elements on different pages
Almost there with this...just need to show the jquery slider on the home page.
Instead of using 'catalog' is there another way of hiding the top code on the category pages but showing it on the home? {if ($main neq 'product' and $main neq 'catalog' and $main neq 'catalog' and $main neq 'cart' or $cart_empty) and $main neq 'checkout'} <div id="banner"> Jquery banner thing </div><!-- / banner --> {/if} {if $current_category.category neq ""} <div id="banner"> <img src="{if $current_category.icon_url}{$current_category.icon _url} {else}{$xcart_web_dir}/image.php?id={$cat}&type=C{/if}" alt="Alt here" /> </div><!-- / banner --> {/if}
__________________
------------------------------------------------ Darren |
|||||||
#5
|
|||||||||
|
|||||||||
Re: Hiding and showing elements on different pages
The home page itself is defined by
$main eq "catalog" and $current_category.category eq "" So you'll need to combine this into your if statement.
__________________
Paul Dodman e-business & m-commerce consultant w: www.luminointernet.com e: xcart@luminointernet.com Professional X-Cart help, advice, support and services, specialists in Mobile X-Cart. |
|||||||||
|
#6
|
|||||||
|
|||||||
Re: Hiding and showing elements on different pages
Thanks a lot Paul, got there in the end:
{if ($main neq 'product' and $current_category.category eq "" and $main neq 'cart' or $cart_empty) and $main neq 'checkout'} <div id="banner"> Jquery banner thing </div><!-- / banner --> {/if}
__________________
------------------------------------------------ Darren |
|||||||
|
|||
X-Cart forums © 2001-2020
|