Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    May 2009
    Posts
    222
    Plugin Contributions
    1

    Default Display individual sidebox on only one Ez Page

    Hi

    Following the instructions here https://www.zen-cart.com/tutorials/i...hp?article=249

    if (!isset($ezpage_id) || !in_array($ezpage_id,explode(",",'2,5'))) {

    This condition means that the template to display the sidebox will be called whenever the page is not an EZ-Page or, if it is an EZ-Page, it does not have ID 2 or 5

    What i want is a condition that will display the sidebox only when it is an EZ page and only when that EZ page ID is X

    I hope someone can help!

    Ive also seen this

    https://www.zen-cart.com/tutorials/i...hp?article=270

    if ($this_is_home_page) { ......

    Could i change that to .,. if this is ez page id X then.......


    How can i do this?

    Thanks you

  2. #2
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Display individual sidebox on only one Ez Page

    PHP Code:
    if (isset($ezpage_id) and $ezpage_id == '3') { 

  3. #3
    Join Date
    May 2009
    Posts
    222
    Plugin Contributions
    1

    Default Re: Display individual sidebox on only one Ez Page

    thanks for that

  4. #4
    Join Date
    May 2009
    Posts
    222
    Plugin Contributions
    1

    Default Re: Display individual sidebox on only one Ez Page

    <?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_bangkok = true;

    if ($show_blank_sidebox_bangkok == true) {
    if (isset($ezpage_id) and $ezpage_id == '1') {
    require($template->get_template_dir('tpl_blank_sidebox_bangkok.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_blank_sidebox_bangkok.php');
    $title = BOX_HEADING_BLANK_SIDEBOX_BANGKOK;
    $title_link = false;
    require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
    }
    ?>


    breaks my site

  5. #5
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Display individual sidebox on only one Ez Page

    PHP Code:
    // test if box should display
    $show_blank_sidebox_bangkok false;
    if (isset(
    $ezpage_id) and $ezpage_id == '1') { 
      
    $show_blank_sidebox_bangkok true;
    }

    if (
    $show_blank_sidebox_bangkok == true) {
      require(
    $template->get_template_dir('tpl_blank_sidebox_bangkok.php',DIR_WS_TEMPLATE$current_page_base,'sideboxes'). '/tpl_blank_sidebox_bangkok.php'); 

  6. #6
    Join Date
    May 2009
    Posts
    222
    Plugin Contributions
    1

    Default Re: Display individual sidebox on only one Ez Page

    ah ha - do appologise i missed a curly bracket at the end works now thank so much

  7. #7
    Join Date
    May 2009
    Posts
    222
    Plugin Contributions
    1

    Default Re: Display individual sidebox on only one Ez Page

    i did this.. works

    <?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_bangkok = true;

    if ($show_blank_sidebox_bangkok == true) {
    if (isset($ezpage_id) and $ezpage_id == '1') {
    require($template->get_template_dir('tpl_blank_sidebox_bangkok.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_blank_sidebox_bangkok.php');
    $title = BOX_HEADING_BLANK_SIDEBOX_BANGKOK;
    $title_link = false;
    require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
    }
    }
    ?>

  8. #8
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Display individual sidebox on only one Ez Page

    Yes, that will work, though it ignores the purpose of the $show_whatever flag.

  9. #9
    Join Date
    Jan 2012
    Posts
    59
    Plugin Contributions
    0

    Default Re: Display individual sidebox on only one Ez Page

    How would this work with an overridden sidebox that does not contain the specified code:


    Code:
     require($template->get_template_dir('tpl_order_history.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_order_history.php');
        $title =  BOX_HEADING_CUSTOMER_ORDERS;
        $title_link = false;
        require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);

    thanks!

  10. #10
    Join Date
    Jan 2012
    Posts
    59
    Plugin Contributions
    0

    Default Re: Display individual sidebox on only one Ez Page

    here is my code :

    Code:
    <?php
    // -----------------------------------
    // MY CUSTOM SIDE PANEL ITEM
    // -----------------------------------
    
      // test if box should be displayed
     
      $show_categories = true;
    
      if ($show_categories  == true) {
    
    some html code;
    
    }
    ?>

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v150 Sidebox on one ez page ID only
    By buildingblocks in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 29 Feb 2012, 12:52 AM
  2. display only one feature product in sidebox
    By MatchManhattan in forum Setting Up Specials and SaleMaker
    Replies: 1
    Last Post: 21 May 2008, 06:53 AM
  3. Limit subcategory display in sidebox to one level only
    By kusogaki in forum Setting Up Categories, Products, Attributes
    Replies: 6
    Last Post: 19 Feb 2008, 11:04 PM
  4. I need to have a particular sidebox only show on one EZ page.
    By tolefairy in forum General Questions
    Replies: 0
    Last Post: 20 Jan 2008, 07:20 AM
  5. Display custom sidebox only on one page.
    By shackle in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 29 Aug 2007, 09:28 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