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

Remove Sidebar & Gap from Only Homepage

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 07-16-2013, 06:26 AM
 
liamb2001 liamb2001 is offline
 

eXpert
  
Join Date: May 2006
Posts: 216
 

Unhappy Remove Sidebar & Gap from Only Homepage

Hi can anyone tell me how i would remove the left sidebar from the homepage only please ?

I have changed the code in content.tpl to

</div><!-- /center-main -->
{if ($main neq 'cart' or $cart_empty) and $main neq 'checkout' and $main ne 'product' and ($main ne "catalog" or $current_category.category ne "")}
<div id="left-bar">
{include file="customer/left_bar.tpl"}
</div>
{/if}


at the bottom and it has removed it but with the problem the gap / space is still there...im trying to make it so the featured products on the homepage use the full page width

would really appreciate some help
__________________
X-Cart Version 4.55
Reply With Quote
  #2  
Old 07-16-2013, 06:46 AM
 
philrisk philrisk is offline
 

X-Adept
  
Join Date: Jul 2009
Location: Newcastle upon Tyne, UK
Posts: 412
 

Default Re: Remove Sidebar & Gap from Only Homepage

PHP Code:
<div id="center-main" {if $cat eq '0'}style="margin: 0 15px;"{/if}>
</
div

Add the if statement to the "center-main" div.
__________________
Live with Gold 4.5.1
Dedicated Linux server
MaxCDN 4 pull zones
Dedicated SSL

Reply With Quote
  #3  
Old 07-16-2013, 11:35 PM
 
liamb2001 liamb2001 is offline
 

eXpert
  
Join Date: May 2006
Posts: 216
 

Default Re: Remove Sidebar & Gap from Only Homepage

worked perfectly mate thanks for taking the time to reply i appreciate it
__________________
X-Cart Version 4.55
Reply With Quote
  #4  
Old 07-16-2013, 11:53 PM
 
philrisk philrisk is offline
 

X-Adept
  
Join Date: Jul 2009
Location: Newcastle upon Tyne, UK
Posts: 412
 

Wink Re: Remove Sidebar & Gap from Only Homepage

Quote:
Originally Posted by liamb2001
worked perfectly mate thanks for taking the time to reply i appreciate it

Your welcome.
__________________
Live with Gold 4.5.1
Dedicated Linux server
MaxCDN 4 pull zones
Dedicated SSL

Reply With Quote
  #5  
Old 07-17-2013, 12:11 AM
 
liamb2001 liamb2001 is offline
 

eXpert
  
Join Date: May 2006
Posts: 216
 

Default Re: Remove Sidebar & Gap from Only Homepage

I just realised that the sidebar is missing from the product page.its showing on the category page but i need it to show on the product page as well, any ideas ?

It must be something to do with this code ?
{if ($main neq 'cart' or $cart_empty) and $main neq 'checkout' and $main ne 'product' and ($main ne "catalog" or $current_category.category ne "")}
__________________
X-Cart Version 4.55
Reply With Quote
  #6  
Old 07-17-2013, 12:19 AM
 
philrisk philrisk is offline
 

X-Adept
  
Join Date: Jul 2009
Location: Newcastle upon Tyne, UK
Posts: 412
 

Default Re: Remove Sidebar & Gap from Only Homepage

Yes it looks like you have too many 'and's.

Try something like:
{if (($main neq 'cart' or $cart_empty) and $main neq 'checkout') or $main ne 'product' or $cat ne '0'}
__________________
Live with Gold 4.5.1
Dedicated Linux server
MaxCDN 4 pull zones
Dedicated SSL

Reply With Quote
  #7  
Old 07-17-2013, 12:22 AM
 
liamb2001 liamb2001 is offline
 

eXpert
  
Join Date: May 2006
Posts: 216
 

Default Re: Remove Sidebar & Gap from Only Homepage

nearly that fixed on the product page but also brought it back to the homepage

http://www.modernwatch.co.uk/home.php
__________________
X-Cart Version 4.55
Reply With Quote
  #8  
Old 07-17-2013, 12:52 AM
 
philrisk philrisk is offline
 

X-Adept
  
Join Date: Jul 2009
Location: Newcastle upon Tyne, UK
Posts: 412
 

Default Re: Remove Sidebar & Gap from Only Homepage

Actually some things not right as $main ne 'product' should make it not appear on the product page. I know its not the best way of doing it but this is how I have mine:
{if ($main neq 'cart' or $cart_empty) and $main neq 'checkout'}
{if $main neq 'product'}
{if $main neq 'authentication'}
{if $main neq 'giftcert'}
{if $main neq 'help'}
{if $main neq 'register'}
{if $main neq 'pages'}
{if $main neq 'wordpress'}
{if $main neq 'order_message'}
{if $main neq 'address_book'}
{if $main neq 'orders'}
{if $main neq 'customer_bonuses'}
{if $main neq 'wishlist'}
{if $main neq 'error_ccprocessor_error'}
{if $main neq '403'}
{if $main neq 'survey'}
{if $main neq 'surveys'}
{if $cat neq '0'}
{if $manufacturerid neq '0'}

left bar.tpl

followed by an equal amount of {/if}s
__________________
Live with Gold 4.5.1
Dedicated Linux server
MaxCDN 4 pull zones
Dedicated SSL

Reply With Quote
  #9  
Old 07-17-2013, 12:54 AM
 
philrisk philrisk is offline
 

X-Adept
  
Join Date: Jul 2009
Location: Newcastle upon Tyne, UK
Posts: 412
 

Default Re: Remove Sidebar & Gap from Only Homepage

Try doing it that way just to get the variables right for the pages you want and then we can compress it into one if statement if you want.
__________________
Live with Gold 4.5.1
Dedicated Linux server
MaxCDN 4 pull zones
Dedicated SSL

Reply With Quote
  #10  
Old 07-17-2013, 01:08 AM
 
liamb2001 liamb2001 is offline
 

eXpert
  
Join Date: May 2006
Posts: 216
 

Default Re: Remove Sidebar & Gap from Only Homepage

ok will do mate

to confirm you mentioned $main ne 'product' should make it not appear on the product page ?

Thats actually correct, the sidebar is NOT appearing on the product page but i want it to.
__________________
X-Cart Version 4.55
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 03:36 AM.

   

 
X-Cart forums © 2001-2020