Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2009
    Posts
    149
    Plugin Contributions
    0

    Default show sidebox on pages other than homepage

    Hi I tried following this tutorial but doing it in reverse to show a sidebox on everything other than my homepage. But it doesn't seem to work.
    https://www.zen-cart.com/tutorials/i...hp?article=270

    I tried it with the blank sidebox module here
    http://www.zen-cart.com/index.php?ma...roducts_id=174

    the module works find as it is when I download it.

    the code of the default blank_sidebox.php is

    Code:
    <?php
    /**
     * blank sidebox - allows a blank sidebox to be added to your site
     *
     * @package templateSystem
     * @copyright 2007 Kuroi Web Design
      * @copyright Portions Copyright 2003-2007 Zen Cart Development Team
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: blank_sidebox.php 2007-05-26 kuroi $
     */
    
      // test if box should display
      $show_blank_sidebox = true;
    
      if ($show_blank_sidebox == true) {
          require($template->get_template_dir('tpl_blank_sidebox.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_blank_sidebox.php');
          $title =  BOX_HEADING_BLANK_SIDEBOX;
          $title_link = false;
          require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
     }
    ?>

    I tried to alter it following the tutorial to this

    Code:
    <?php
    /**
     * blank sidebox - allows a blank sidebox to be added to your site
     *
     * @package templateSystem
     * @copyright 2007 Kuroi Web Design
      * @copyright Portions Copyright 2003-2007 Zen Cart Development Team
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: blank_sidebox.php 2007-05-26 kuroi $
     */
    
      // test if box should display
      if ($this_is_home_page) {
        $show_blank_sidebox == false;
      } else {
        $show_blank_sidebox == true;
      }
    
      if ($show_blank_sidebox == true) {
          require($template->get_template_dir('tpl_blank_sidebox.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_blank_sidebox.php');
          $title =  BOX_HEADING_BLANK_SIDEBOX;
          $title_link = false;
          require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
     }
    ?>

    Can anyone tell me what I did wrong?

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: show sidebox on pages other than homepage

    The way this is written:
    Code:
      // test if box should display
      if ($this_is_home_page) {
    // I am on the home page
        $show_blank_sidebox == false;
    // false meanse do not show
      } else {
    // I am not on the home page
        $show_blank_sidebox == true;
    // true means show it
      }
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Apr 2009
    Posts
    149
    Plugin Contributions
    0

    Default Re: show sidebox on pages other than homepage

    Yes I wanted to show it on pages that are not the homepage?

    I admit I know nothing at all about php, just thought it seemed logical.

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: show sidebox on pages other than homepage

    IF you set it to false for when $this_is_home_page is true then it will not show on the Home page ...

    Make sure that you are uploading the file to the right directory after making your changes ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    Apr 2009
    Posts
    149
    Plugin Contributions
    0

    Default Re: show sidebox on pages other than homepage

    So the code above is right for what I want it to do and should work?

    Thanks for your help.

  6. #6
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,024
    Plugin Contributions
    3

    Default Re: show sidebox on pages other than homepage

    Here's how it's done for the Categories box. You should be able to adapt it to other sideboxes.

    http://www.zen-cart.com/forum/showthread.php?t=121318

    Compare it to the stock categories box code to see what's been added.

    Mostly, you're just wrapping the sidebox code in an "if - else" statement.

  7. #7
    Join Date
    Apr 2009
    Posts
    149
    Plugin Contributions
    0

    Default Re: show sidebox on pages other than homepage

    Thanks, I got it to work with this. Altough I still don't understand why the first one didn't work.

    Code:
    <?php
    /**
     * blank sidebox - allows a blank sidebox to be added to your site
     *
     * @package templateSystem
     * @copyright 2007 Kuroi Web Design
      * @copyright Portions Copyright 2003-2007 Zen Cart Development Team
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: blank_sidebox.php 2007-05-26 kuroi $
     */
    
      // test if box should display
      if ($this_is_home_page) {
        $show_blank_sidebox == false;
      } else {
          require($template->get_template_dir('tpl_blank_sidebox.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_blank_sidebox.php');
          $title =  BOX_HEADING_BLANK_SIDEBOX;
          $title_link = false;
          require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
     }
    ?>

 

 

Similar Threads

  1. Ez-Pages Sidebox show some links on one side and others on the other side
    By brettw in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 21 Nov 2008, 12:41 PM
  2. Pages other than homepage have stopped working after SEO mod change
    By dealbyethan.com in forum General Questions
    Replies: 0
    Last Post: 6 Jun 2007, 03:30 PM
  3. Show products on page OTHER than categories
    By Pablosan in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 3 Feb 2007, 11:00 AM
  4. Doing File Uploads on Pages other than Products
    By jaxbakers in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 5 Jul 2006, 09:29 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR