Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2009
    Posts
    59
    Plugin Contributions
    0

    Default Create a Global Sidebox

    Hi all,
    I have been reading around the forums and web trying to work it out and i'm still a bit at a lost.

    https://www.ozresort.com.au/ is the site i am talking about.

    I want to display tpl_womens_sidebox.php on every page (products, categories, EZ Pages, etc.. ). At the moment it is only shown on category pages that are defined in the file.

    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 $
     */
    
      $sql = "select count(*) as total
              from " . TABLE_PRODUCTS . " p, " .
                       TABLE_PRODUCTS_DESCRIPTION . " pd
              where    p.products_status = '1'
              and      p.products_id = '" . (int)$_GET['products_id'] . "'
              and      pd.products_id = p.products_id
              and      pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";
    
    
    
      $products_id_current = (int)$_GET['products_id'];
    
      $content = '';
      $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';
      
      // Replace the text and HTML tags between the apostophes on lines 19 and 20.
      // Use as many or as few lines using this model as you need for your custom content.
      // If you have a multilingual site define your text in the languages/YOUR_LANGUAGE/extra_definitions/blank_sidebox_defines.php and include it as shown in line 19.
      // If your site is monolingual, you can put the text right here as shown on line 20 (and nobody will know!)
    
    
    
    //BY SWIMWEAR BRAND > TOP LEVEL CATEGORY	 
    	if ($current_page=='index' && $cPath=='1_7') 
    	{
      	$content .= '<img src="images/spacer.gif" height="5" width="100"><br>
    				<a href="index.php?main_page=index&cPath=1_7"><strong><font color="#006282">BY SWIMWEAR BRAND</font></strong></a><br />
    				<img src="images/spacer.gif" height="5" width="100"><br>
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_7_38">SEAFOLLY</a><br /> 
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_7_13">BAKU</a><br />
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_7_15">JETS BY JESSIKA ALLEN</a><br />
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_7_103">MIRACLESUIT</a><br />
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_7_149">GINJA</a><br />
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_7_104">GOTTEX</a><br />				
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_7_91">SPEEDO</a><br />
    &nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=490">AMANZI</a><br />
    &nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=492">BERZELLI</a><br />
    &nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=301">SHAPEWEAR</a><br />
    &nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=310">JETS TAILOR TO SUIT</a><br />
    &nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=275">RIVAL</a><br />
    &nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=219">FIREFLY KAFTANS</a><br />
    				<BR>
    				<a href="index.php?main_page=index&cPath=1_8"><strong>BY SWIMWEAR STYLE</strong></a><br />
      				<img src="images/spacer.gif" height="5" width="100"><br>
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_8_136">KAFTANS</a><br />
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_8_78">RESORT WEAR</a><br />
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_8_126">BRAZILLIAN</a><br />
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_8_18">TRIANGLE</a><br />
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_8_19">BOOSTER</a><br />
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_8_20">TIE SIDE</a><br />
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_8_21">BOY LEG</a><br />
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_8_22">SINGLET</a><br />
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_8_162">PLUS SIZES</a><br />
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_8_23">ONE PIECE</a><br />
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_8_24">D/DD - E/F CUP</a><br />
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_8_25">TUMMY CONTROL</a><br />
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_8_26">BOARD SHORTS</a><br />
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_8_92">RACING / POOL</a><br />
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_8_27">SUN PROTECTION</a><br />
    
    
    				';
    				} 
    //BEACHFRONT
    if ($current_page=='index' && $cPath=='1_7_157' ) {
      	$content .= '<img src="images/spacer.gif" height="5" width="100"><br>
    				<a href="index.php?main_page=index&cPath=1_7"><strong><font color="#006282">BY SWIMWEAR BRAND</font></strong></a><br />
    				<img src="images/spacer.gif" height="5" width="100"><br>
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_7_38">SEAFOLLY</a><br /> 
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_7_13">BAKU</a><br />
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_7_15">JETS BY JESSIKA ALLEN</a><br />
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_7_103">MIRACLESUIT</a><br />
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_7_149">GINJA</a><br />
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_7_104">GOTTEX</a><br />				
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_7_91">SPEEDO</a><br />
    &nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=490">AMANZI</a><br />
    &nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=492">BERZELLI</a><br />
    &nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=301">SHAPEWEAR</a><br />
    &nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=310">JETS TAILOR TO SUIT</a><br />
    &nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=275">RIVAL</a><br />
    &nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=219">FIREFLY KAFTANS</a><br />
    				<BR>
    				<a href="index.php?main_page=index&cPath=1_8"><strong>BY SWIMWEAR STYLE</strong></a><br />
      				<img src="images/spacer.gif" height="5" width="100"><br>
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_8_136">KAFTANS</a><br />
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_8_78">RESORT WEAR</a><br />
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_8_126">BRAZILLIAN</a><br />
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_8_18">TRIANGLE</a><br />
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_8_19">BOOSTER</a><br />
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_8_20">TIE SIDE</a><br />
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_8_21">BOY LEG</a><br />
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_8_22">SINGLET</a><br />
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_8_162">PLUS SIZES</a><br />
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_8_23">ONE PIECE</a><br />
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_8_24">D/DD - E/F CUP</a><br />
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_8_25">TUMMY CONTROL</a><br />
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_8_26">BOARD SHORTS</a><br />				
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_8_92">RACING / POOL</a><br />
    				&nbsp;&nbsp;::&nbsp;<a href="index.php?main_page=index&cPath=1_8_27">SUN PROTECTION</a><br />
    ';
    				} 
    
      $content .= '</div>';
      
    ?>
    <div class="leftBoxContainer" id="<?php echo str_replace('_', '-', $box_id ); ?>" style="width: <?php echo $column_width; ?>">
    <?php echo $content; ?>
    </div>
    What do i have to do to make this sidebox display globally? I'm at a loss and don't know what to do next.

    Thanks in advance.

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

    Default Re: Create a Global Sidebox

    $_GET['products_id'] will only be defined on an individual product page. What are you trying to do with the sql? As is, it doesn't have any function at all, regardless of the product id.

    The content output created here does not influence whether the sidebox shows at all; that is the job of the module file (/includes/modules/blank_sidebox.php or /includes/modules/your_template/blank_sidebox.php). What is in the module file?

    Also, you have hard-coded a rep li ca of the categories sidebox, which means any time a category or subcat is added or deleted, you will have to edit this file as well. You could use Categories Dressing to do this dynamically.

    The forum software won't let the word r e p l i c a be used! :)
    Last edited by gjh42; 17 May 2010 at 06:12 PM.

  3. #3
    Join Date
    Aug 2009
    Posts
    59
    Plugin Contributions
    0

    Default Re: Create a Global Sidebox

    Thanks for that,

    the following was in /includes/modules/sideboxes which was the closest i could find to where you pointed me.

    Code:
    <?php
    /**
     * style sidebox - allows a style 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: style_sidebox.php 2007-05-26 kuroi $
     */
    
      // test if box should display
      $show_womens_sidebox = true;
    
      if ($show_womens_sidebox == true) {
          require($template->get_template_dir('tpl_womens_sidebox.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_womens_sidebox.php');
    //      $title =  BOX_HEADING_WOMENS_SIDEBOX;
    //      $title_link = false;
    //      require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
     }
    ?>

    It sounds like the whole thing is a mess (i didn't make the site don't know enough) and it might be easier for me to just create a new sidebox to show everywhere.

    Or how to i change that file so that it shows everywhere.

    Thanks so much for your help so far. I'm willing to do what ever i need to to get this to work.

  4. #4
    Join Date
    Aug 2009
    Posts
    59
    Plugin Contributions
    0

    Default Re: Create a Global Sidebox

    I went another way to find a solution and running with gjh42's idea of a module i got absolute_links_sidebox_102 which i compied what i wanted to show and then installed it and got rid of the one that was badly coded. Problem seems solved now and is working better than before, still wish i knew what was wrong before though...

    gjh42 if you can see what is wrong in the file i posted in the previous post then i would love to hear it.

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

    Default Re: Create a Global Sidebox

    Oops, /includes/modules/sideboxes/ is indeed the correct location for a sidebox module file. The one you show would display on every page, assuming it has the same filename base as the tpl_ file (womens_sidebox.php?). It has some standard parts commented out with //, though, so not sure if or how it would function.

 

 

Similar Threads

  1. Create a New Sidebox
    By cartdiscounts in forum Addon Sideboxes
    Replies: 12
    Last Post: 21 Mar 2010, 09:16 PM
  2. Replies: 2
    Last Post: 27 Mar 2007, 03:25 PM
  3. Create Button in Sidebox
    By HandcraftedUK in forum Basic Configuration
    Replies: 5
    Last Post: 22 Nov 2006, 10:01 PM
  4. Howto: Create Sidebox
    By RobWUK in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 22 Oct 2006, 07:53 PM

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