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

Hiding and showing elements on different pages

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 02-04-2011, 12:33 AM
 
mekon mekon is offline
 

Senior Member
  
Join Date: Jan 2011
Posts: 180
 

Default 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}&amp;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
Reply With Quote
  #2  
Old 02-04-2011, 01:46 AM
  pauldodman's Avatar 
pauldodman pauldodman is offline
 

X-Guru
  
Join Date: Jul 2003
Location: Spain / UK
Posts: 3,054
 

Default 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.
Reply With Quote
  #3  
Old 02-04-2011, 02:14 AM
 
mekon mekon is offline
 

Senior Member
  
Join Date: Jan 2011
Posts: 180
 

Default Re: Hiding and showing elements on different pages

Thanks for the reply Paul, that hides it on the home page too though
__________________
------------------------------------------------

Darren
Reply With Quote
  #4  
Old 02-04-2011, 02:34 AM
 
mekon mekon is offline
 

Senior Member
  
Join Date: Jan 2011
Posts: 180
 

Default 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}&amp;type=C{/if}" alt="Alt here" />
</div><!-- / banner -->

{/if}
__________________
------------------------------------------------

Darren
Reply With Quote
  #5  
Old 02-04-2011, 02:36 AM
  pauldodman's Avatar 
pauldodman pauldodman is offline
 

X-Guru
  
Join Date: Jul 2003
Location: Spain / UK
Posts: 3,054
 

Default 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.
Reply With Quote

The following user thanks pauldodman for this useful post:
mekon (02-04-2011)
  #6  
Old 02-04-2011, 04:27 AM
 
mekon mekon is offline
 

Senior Member
  
Join Date: Jan 2011
Posts: 180
 

Default 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
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:44 PM.

   

 
X-Cart forums © 2001-2020