Forums / Templates, Stylesheets, Page Layout / Display sidebox only on certain pages

Display sidebox only on certain pages

Views: 3,941

Results 21 to 25 of 25
23 Nov 2011, 8:53 PM
#21
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Display sidebox only on certain pages

The styling of sideboxes is another topic altogether, and not related to the topic being discussed in this thread.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

20 Jan 2012, 9:00 AM
#22
4jdesigns avatar

4jdesigns

Zen Follower

Join Date:
Jul 2011
Posts:
106
Plugin Contributions:
0

Re: Display sidebox only on certain pages

Hi All,

Just thought I'd add my 2 cents worth, hopefully it may help someone too.

This only works if you have your products in a category, but I'm sure that's normal anyway.

To show left or right sidebox ONLY TO ALL categories and products, NOT other pages e.g. home, about us, contact, shippinginfo etc.....

.....in common/tpl_main_page.php I added this:

<?php   
if ($current_category_id >= 1) { ?>
  <td id="navColumnOne" class="columnLeft" style="width: <?php echo COLUMN_WIDTH_LEFT; ?>">
  <?php
  /**
  * prepares and displays left column sideboxes
  *
  */
  ?>
  <div id="navColumnOneWrapper" style="width: <?php echo BOX_WIDTH_LEFT; ?>"><?php require(DIR_WS_MODULES . zen_get_module_directory('column_left.php')); ?></div></td>
<?php 
} else { } ?>

This is to my left sidebox, but the same applies to the right side's code.
This should do all categories because it states any category greater than or equal to 1. Products will display sidebox too granted they are setup inside a category.

Hope this helps someone out.
Jay.

17 Apr 2012, 8:26 PM
#23
cjsmiff avatar

cjsmiff

Zen Follower

Join Date:
Jul 2006
Location:
UK
Posts:
170
Plugin Contributions:
0

Re: Display sidebox only on certain pages

Hi,

Does anyone know how I would make a sidebox appear only on the Product Info page please?

I've tried

if ($product_info) {
    $show_featured = true;
  } else {
    $show_featured = false;
  }

But it's not working. Any suggestions most welcome!

Claire
:blink:

19 Apr 2012, 8:51 PM
#25
cjsmiff avatar

cjsmiff

Zen Follower

Join Date:
Jul 2006
Location:
UK
Posts:
170
Plugin Contributions:
0

Re: Display sidebox only on certain pages

:clap:

Thank you for your help.