Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2014
    Location
    The Netherlands
    Posts
    58
    Plugin Contributions
    0

    help question Rearranging Sideboxes on Certain Pages

    Hi guys, I was hoping someone might be able to help me out with the following. I'm looking for a way to rearrange the sideboxes on certain pages. For example, at the moment the Information sidebox is located 'below the fold' on the Contact Us page, but I would like to move this to the top of the sidebar so that it will be the first thing a visitor sees when he goes to the Contact Us page. Unfortunately I don't really know what the best method would be to address this.

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

    Default Re: Rearranging Sideboxes on Certain Pages

    You want all the same sideboxes to appear on all pages, but that one box to appear in a different place on that one page?

  3. #3
    Join Date
    Jul 2012
    Posts
    14,209
    Plugin Contributions
    17

    Default Re: Rearranging Sideboxes on Certain Pages

    I don't have the fine details to the solution, but the template file that displays/organizes the left sidebox can be modified with if statements to change the position value based on the value of $current_page.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...
    Upgraded to Zen Cart V1.5.3 from V1.5.1 from V1.5.0 from V1.3.9h

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

    Default Re: Rearranging Sideboxes on Certain Pages

    You could also fiddle with the CSS for that page to place that box with absolute positioning.

  5. #5
    Join Date
    Jul 2012
    Posts
    14,209
    Plugin Contributions
    17

    Default Re: Rearranging Sideboxes on Certain Pages

    Quote Originally Posted by stevesh View Post
    You could also fiddle with the CSS for that page to place that box with absolute positioning.
    See: http://www.zen-cart.com/wiki/index.p...Per-Page-Rules

    for one way to apply the CSS rules to just the desired page(s).
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...
    Upgraded to Zen Cart V1.5.3 from V1.5.1 from V1.5.0 from V1.3.9h

  6. #6
    Join Date
    Feb 2014
    Location
    The Netherlands
    Posts
    58
    Plugin Contributions
    0

    Default Re: Rearranging Sideboxes on Certain Pages

    Thanks for the tips guys! I'll give it a go and keep you posted.

  7. #7
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    8,754
    Plugin Contributions
    68

    Default Re: Rearranging Sideboxes on Certain Pages

    As an alternative, you could also create a template-customized version of /includes/modules/column_left.php (i.e. copy the core file to /includes/modules/YOUR_TEMPLATE/column_left.php and make your edits there). Here's what I came up with for your specified case (information sidebox first on contact_us page):
    Code:
    <?php
    /**
     * column_left module
     *
     * @package templateStructure
     * @copyright Copyright 2003-2006 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: column_left.php 4274 2006-08-26 03:16:53Z drbyte $
     */
    if (!defined('IS_ADMIN_FLAG')) {
      die('Illegal Access');
    }
    $column_box_default='tpl_box_default_left.php';
    // Check if there are boxes for the column
    $column_left_display= $db->Execute("select layout_box_name from " . TABLE_LAYOUT_BOXES . " where layout_box_location = 0 and layout_box_status= '1' and layout_template ='" . $template_dir . "'" . ' order by layout_box_sort_order');
    // safety row stop
    $box_cnt=0;
    $information_sidebox_shown = false;
    if ($current_page_base == FILENAME_CONTACT_US) {
      if ( file_exists(DIR_WS_MODULES . 'sideboxes/information.php') or file_exists(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/information.php') ) {
        $column_width = BOX_WIDTH_LEFT;
        $box_cnt++;
        $information_sidebox_shown = true;
        if ( file_exists(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/information.php') ) {
          $box_id = zen_get_box_id('information.php');
          require(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/information.php');
        } else {
          $box_id = zen_get_box_id ('information.php');
          require(DIR_WS_MODULES . 'sideboxes/information.php');
        }
      }
    }
    while (!$column_left_display->EOF and $box_cnt < 100) {
      $box_cnt++;
      if ( !($information_sidebox_shown && $column_left_display->fields['layout_box_name'] == 'information.php') && (file_exists(DIR_WS_MODULES . 'sideboxes/' . $column_left_display->fields['layout_box_name']) or file_exists(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/' . $column_left_display->fields['layout_box_name']) ) ) {
    ?>
    <?php
    //$column_box_spacer = 'column_box_spacer_left';
    $column_width = BOX_WIDTH_LEFT;
    if ( file_exists(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/' . $column_left_display->fields['layout_box_name']) ) {
      $box_id = zen_get_box_id($column_left_display->fields['layout_box_name']);
      require(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/' . $column_left_display->fields['layout_box_name']);
    } else {
      $box_id = zen_get_box_id($column_left_display->fields['layout_box_name']);
      require(DIR_WS_MODULES . 'sideboxes/' . $column_left_display->fields['layout_box_name']);
    }
      } // file_exists
      $column_left_display->MoveNext();
    } // while column_left
    $box_id = '';
    ?>

 

 

Similar Threads

  1. Why is sideboxes out of side on certain pages
    By navido in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 7 Oct 2011, 03:24 AM
  2. hide sideboxes on certain pages?
    By sheila123 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 3 Sep 2009, 01:58 PM
  3. How to make sideboxes show up on certain pages only?
    By Meshach in forum Basic Configuration
    Replies: 15
    Last Post: 28 Aug 2008, 05:08 PM
  4. Remove sideboxes from certain pages?
    By chrisj in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 28 Aug 2006, 10:40 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