Zen Cart Logo
Forums / General Questions / Show/Hide sideboxes based on page

Show/Hide sideboxes based on page

Views: 43,781

Results 21 to 40 of 189
2 Mar 2007, 2:49 PM
#21
meltdown avatar

meltdown

Totally Zenned

Join Date:
Jun 2006
Location:
My family and I live in Brighton, England
Posts:
947
Plugin Contributions:
0

Show/Hide sideboxes based on page

MeltDown:

That did it!! Thanks Kuroi :smile:

Another (related) question, if I may: The items on the page (such as "New Products For March" for example) are all now aligned to the right. Can you tell me how to center the page?

Thanks again!

2 Mar 2007, 2:55 PM
#22
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Show/Hide sideboxes based on page

Not sure what you mean. If you are referring to the site for which you have provided a link, I can't see this behavior, at least not in Firefox.

2 Mar 2007, 3:38 PM
#23
meltdown avatar

meltdown

Totally Zenned

Join Date:
Jun 2006
Location:
My family and I live in Brighton, England
Posts:
947
Plugin Contributions:
0

Re: Show/Hide sideboxes based on page

Sorry, I keep forgetting that I'm working on someone else's site now and need to provide that link!

PittiVintage

As per your recomendation, I sucessfully added the following code to tpl_main_page.php to remove the sidebox from that page only.

if ($this_is_home_page == true) {
$flag_disable_left = true;
$flag_disable_right = true;
}

However, all items are pulling to the right and I was hoping to correct that.

thanks!

2 Mar 2007, 4:25 PM
#24
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Show/Hide sideboxes based on page

Ah. Yes. Now I see the problem.

The key piece of information not available when the earlier advice was given, was that you are basing your design on jettrue's Apple Zen template.

Unlike the default Zen Cart template that has a layout table designed to create some rigidity and support the site when left, right or both side columns are turned off, Jade designed Apple Zen specifically to work with two columns. Take the right hand one away and the structure collapses.

I recommend taking the question over to the Apple Zen support thread as Jade is the best person to answer it, but be prepared for the possibility that it simply wasn't designed to be able to do this.

2 Mar 2007, 5:05 PM
#25
meltdown avatar

meltdown

Totally Zenned

Join Date:
Jun 2006
Location:
My family and I live in Brighton, England
Posts:
947
Plugin Contributions:
0

Re: Show/Hide sideboxes based on page

OK, I'll take my question over to the Zen Apple thread. I didn't ask there in the first place because I've been pestering Jade with so many questions. I thought this one was more "Zen" and less template but I guess not...:P

Thanks - Tim

10 Mar 2007, 9:26 AM
#26
grandmaj avatar

grandmaj

Zen Follower

Join Date:
Feb 2007
Posts:
104
Plugin Contributions:
0

Re: Show/Hide sideboxes based on page

Since it seems related, I was wondering if you could help with my problem? I need to turn off the right hand column of sideboxes on all product info pages, but leave the column on everywhere else in the site. Is there an efficient way to do this? I know nothing about php, so please be as detailed as you can, if this is even possible.

10 Mar 2007, 9:59 AM
#27
grandmaj avatar

grandmaj

Zen Follower

Join Date:
Feb 2007
Posts:
104
Plugin Contributions:
0

Re: Show/Hide sideboxes based on page

Please disregard my question (above). I found a forum post where someone was trying to turn off sideboxes for his category pages, and I started toying around with the code that they gave him in order to see if I could figure out the pattern and make it work for products pages instead. It worked.

For anyone else trying to turn off the righthand sideboxes on ALL their product pages, I inserted the following in my tpl_main_page.php file, towards the top:

if ($current_page_base == 'product_info' and $products_id >= '') {
$flag_disable_right = true;
}

Please be warned that I'm a "PhP Dummy", so feel free to correct me if this code isn't technically right. All I know is that it works :D

10 Mar 2007, 1:35 PM
#28
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Show/Hide sideboxes based on page

There's a FAQ entry that covers this for a number of different situations.

7 Apr 2007, 11:18 PM
#29
uasport avatar

uasport

New Zenner

Join Date:
Apr 2005
Posts:
11
Plugin Contributions:
0

Re: Show/Hide sideboxes based on page

I need to hide the Logo sidebox mod I added to my site when a use is on the main page only. Any ideas zenners? I read a few threads but none spoke to my situation specifically.

7 Apr 2007, 11:43 PM
#30
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Show/Hide sideboxes based on page

uasport:

I need to hide the Logo sidebox mod I added to my site when a use is on the main page only. Any ideas zenners? I read a few threads but none spoke to my situation specifically.This FAQ entry should speak directly to your situation

14 Jun 2007, 10:29 PM
#31
numinix avatar

numinix

Totally Zenned

Join Date:
Apr 2007
Location:
Vancouver, Canada
Posts:
1,566
Plugin Contributions:
58

Re: Show/Hide sideboxes based on page

How would I do this to make a banner only display on ezpages?

Here is what I have so far in the tpl_main_page.php:

 
<!--bof-banner #5 display -->
<?php
 $show_ezpages = false;
 if (isset($_GET['pages_id']) and zen_pages_id_valid($_GET['pages_id'])) {
        $show_ezpages = true;
    }
  if ($show_ezpages == true) {
   if (SHOW_BANNERS_GROUP_SET5 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET5)) {
     if ($banner->RecordCount() > 0) {
    
?>
<div id="bannerFive" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>
<?php
    }
  }
}
?>
<!--eof-banner #5 display -->

zen_pages_id_valid is a clone of zen_products_id_valid

Right now I'm getting all false and the banner does not display... Hopefully someone can clean up my mess!

15 Jun 2007, 5:38 AM
#32
numinix avatar

numinix

Totally Zenned

Join Date:
Apr 2007
Location:
Vancouver, Canada
Posts:
1,566
Plugin Contributions:
58

Re: Show/Hide sideboxes based on page

Solution:

 
<?php
  if ($_GET['main_page'] == page) {
    // put in the code of the banner display
  }
?> 
15 Jun 2007, 2:35 PM
#33
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Show/Hide sideboxes based on page

Thanks for the update of what worked for you ... :smile:

1 Nov 2007, 8:31 PM
#34
khopek avatar

khopek

Totally Zenned

Join Date:
Aug 2006
Location:
portlandish, oregon
Posts:
795
Plugin Contributions:
0

Re: Show/Hide sideboxes based on page

I disabled sideboxes on my Home Page using this code

if ($this_is_home_page == true) {
$flag_disable_left = true;
$flag_disable_right = true;
}

And one thing I've noticed is... with my Cateogries Dropdown, if you are already in a category and happen to just select "shop by category" it takes you to the Home Page, BUT the Sideboxes appear...

It's showing the link as ..../index.php?main_page=index&cPath=
same with "shop by brand" which is showing .../index.php?manufacturers_id=&main_page=index

What do I need to fix this?

Also to hide just my navbar/breadcrumbs...is $flag_disable_header = true; right? I was just guessing and it seems to work...:blush:

19 Nov 2007, 1:39 AM
#35
mb1 avatar

mb1

Totally Zenned

Join Date:
Jun 2006
Posts:
565
Plugin Contributions:
0

Re: Show/Hide sideboxes based on page

at this moment i just want my reviews sidebox to show up in my ez page #11 how do i go about this

29 Nov 2007, 7:48 AM
#36
monkeyjr47906 avatar

monkeyjr47906

New Zenner

Join Date:
Nov 2007
Posts:
72
Plugin Contributions:
0

Re: Show/Hide sideboxes based on page

Hi I'm working on a site that has about 100 products and I would like, 3 sideboxes unique to each product.

Now using the techniques that I've seen the server would need to "if then" about 300 potential sideboxes ... will this bog down the server?

If so, is there an alternative technique?

Please let me know if my question is unclear.

Thanks.

29 Nov 2007, 10:12 PM
#37
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Show/Hide sideboxes based on page

If these genuinely are unique then yes it will slow things down as all 300 would have to be checked every time a page is loaded to see if they apply.

However, often it's possible to make this easier by having a smaller number of sideboxes containing code that is conditional upon which product is being displayed.

30 Nov 2007, 2:06 PM
#38
monkeyjr47906 avatar

monkeyjr47906

New Zenner

Join Date:
Nov 2007
Posts:
72
Plugin Contributions:
0

Re: Show/Hide sideboxes based on page

Thanks for the reply Kuroi.

I'm really more of an html/graphics guy - would it be too much of a bother to request a code sample? (of the conditional code mentioned - based on a product)

27 Feb 2008, 6:07 AM
#39
dealbyethan_com avatar

dealbyethan_com

Totally Zenned

Join Date:
Dec 2005
Location:
Perth, Western Australia, Australia
Posts:
782
Plugin Contributions:
0

Re: Show/Hide sideboxes based on page

Hi,

On the shopping cart page, there is no point showing showing cart sidebox. How do I turn it off easily?

27 Feb 2008, 8:27 AM
#40
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Show/Hide sideboxes based on page

dealbyethan.com:

On the shopping cart page, there is no point showing showing cart sidebox. How do I turn it off easily?
Admin > Configuration > Layout Settings > Shopping Cart Box Status (set to 2)