Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Apr 2009
    Posts
    23
    Plugin Contributions
    0

    Default Moving Sidebox to Center Column

    Hi all,

    I've installed the "What's New Scroller" sidebox, which works fine.

    I now want to move it into the center of the index page.

    I've tried using the "Sidebox Anywhere" mod (I realise it's designed to reproduce a sidebox on an external site) to get the whats_new box to appear where I want it, by adding the following:

    Code:
    <?php
    // BOF Sidebox Anywhere MOD
    
    $zcSBmodule = 'tpl_whats_new.php'; // name of sidebox or centerbox to be displayed (see filenames in the /includes/modules/sideboxes folder) (if not set, uses "whats_new.php")
    
    $zcSBlayout = 'left'; // 'left' or 'right' sidebox template style (if not specified, uses 'left')
    
    require("includes/templates/template_default/sideboxes/single_sidebox.php");
    
    // EOF Sidebox Anywhere MOD
    ?>
    into tpl_index_default.php. I either just get the above code displaying on the page, or only half of the page displays, depending on where within that file I put the above code.

    Am I going about this in the correct way? Or is there another way to move a sidebox to somewhere specific?

    wwwdotavantebagsdotcom

    Many thanks.

  2. #2
    Join Date
    Oct 2006
    Location
    Alberta, Canada
    Posts
    4,571
    Plugin Contributions
    1

    Default Re: Moving Sidebox to Center Column

    All you would be moving is the javascript code.

    To place on the site Home page use:
    Admin > Tools > Define Pages Editor and select: main_page.php to edit

    Put the javascript in its own DIV and style as necessary.

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

    Default Re: Moving Sidebox to Center Column

    Thanks for your reply Rob.

    Is it just this that I would need to put in the div:

    Code:
    //  ----------------------------------------------------------------------------------
    //   START CONFIGURABLES VALUES:
    //   Change the values here to modify how the marquee looks and works
    //  ----------------------------------------------------------------------------------
    
    	$scroll_amount =    "1"; 		// scroll amount
    	$scroll_delay =     "5";  		// scroll delay
    	$scroll_direction = "up"; 		// scroll direction (can be up, down, left or right)
    	$scroll_behaviour = "scroll"; 	// scroll behaviour (can be scroll, alternate or slide) ** Seems to make no diff **
    	$box_height =       "130"; 		// height of whats new box
    
    //  ----------------------------------------------------------------------------------
    //   END CONFIGURABLES VALUES.
    //  ----------------------------------------------------------------------------------
    
    
    
    
    
    
    //  ----------------------------------------------------------------------------------
    //   DO NOT EDIT THE FOLLOWING CODE.
    //   NB: added lines to the original template are highlighted with comments.
    //  ----------------------------------------------------------------------------------
    
      $content = "";
      $whats_new_box_counter = 0;
      //-------------------------------------------------------------------------------------------------------------------------------
      $content .= '<marquee behavior= "' . $scroll_behaviour . '" align= "center" direction= "' . $scroll_direction . '" height="' . $box_height . '" scrollamount= "' . $scroll_amount . '" scrolldelay= "' . $scroll_delay . '" onmouseover=\'this.stop()\' onmouseout=\'this.start()\'><center>';
      //-------------------------------------------------------------------------------------------------------------------------------  
      while (!$random_whats_new_sidebox_product->EOF) {
        $whats_new_box_counter++;
        $whats_new_price = zen_get_products_display_price($random_whats_new_sidebox_product->fields['products_id']);
        $content .= '<div class="sideBoxContent centeredContent">';
        $content .= '<a href="' . zen_href_link(zen_get_info_page($random_whats_new_sidebox_product->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($random_whats_new_sidebox_product->fields['master_categories_id']) . '&products_id=' . $random_whats_new_sidebox_product->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $random_whats_new_sidebox_product->fields['products_image'], $random_whats_new_sidebox_product->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
        $content .= '<br />' . $random_whats_new_sidebox_product->fields['products_name'] . '</a>';
        $content .= '<div>' . $whats_new_price . '</div>';
        $content .= '</div>';
      //-------------------------------------------------------------------------------------------------------------------------------
        $content .= '<br />';
      //-------------------------------------------------------------------------------------------------------------------------------
        $random_whats_new_sidebox_product->MoveNextRandom();
      }
      //-------------------------------------------------------------------------------------------------------------------------------
      $content .= '</center></marquee>';
      //-------------------------------------------------------------------------------------------------------------------------------
    ?>
    Thankyou.

  4. #4
    Join Date
    Oct 2006
    Location
    Alberta, Canada
    Posts
    4,571
    Plugin Contributions
    1

    Default Re: Moving Sidebox to Center Column

    The code you show has been customized to work within a Sidebox. Not sure exactly what you want to do but using the code and putting in the "main_page.php" is a start. Some tweaking may be required.

    Or you could go to a script site like http://www.dynamicdrive.com/ and get one of their Scrolling scripts.

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

    Default Re: Moving Sidebox to Center Column

    I'm keen to use something like this so that it updates as the Featured/Specials etc are updated.

    wwwdotavantebagsdotcom shows what happens when I put the above code in. Not good! I'll have a fiddle...

    Thanks for your help.

  6. #6
    Join Date
    Apr 2009
    Posts
    23
    Plugin Contributions
    0

    Default Re: Moving Sidebox to Center Column

    Also, am I correct in thinking that Define Pages Editor won't accept php code?

    If not, how can I mange to get the scroller in there?

    Thanks.

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

    Default Re: Moving Sidebox to Center Column

    So, if I was to use this scroller script, how can I insert the new products?

    I've tried inserting the contents of tpl_whats_new.php, but it's not working at all.

    I'm assuming that the completed code needs to be inserted into tpl_index_default.php?

    The code I concocted was:

    Code:
    <div id="marqueecontainer" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">
    <div id="vmarquee" style="position: absolute; width: 98%;">
    
    <!--YOUR SCROLL CONTENT HERE-->
    
    <?php
    /**
     * Side Box Template
     *
     * @package templateSystem
     * @copyright Copyright 2003-2007 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: tpl_whats_new.php 6128 2007-04-08 04:53:32Z birdbrain $
     */
      $content = "";
      $whats_new_box_counter = 0;
      while (!$random_whats_new_sidebox_product->EOF) {
        $whats_new_box_counter++;
        $whats_new_price = zen_get_products_display_price($random_whats_new_sidebox_product->fields['products_id']);
        $content .= '<div class="sideBoxContent centeredContent">';
        $content .= '<a href="' . zen_href_link(zen_get_info_page($random_whats_new_sidebox_product->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($random_whats_new_sidebox_product->fields['master_categories_id']) . '&products_id=' . $random_whats_new_sidebox_product->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $random_whats_new_sidebox_product->fields['products_image'], $random_whats_new_sidebox_product->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
        $content .= '<br />' . $random_whats_new_sidebox_product->fields['products_name'] . '</a>';
        $content .= '<div>' . $whats_new_price . '</div>';
        $content .= '</div>';
        $random_whats_new_sidebox_product->MoveNextRandom();
      }
    ?>
    
    
    <!--YOUR SCROLL CONTENT HERE-->
    
    </div>
    </div>

  8. #8
    Join Date
    Dec 2009
    Posts
    32
    Plugin Contributions
    0

    Default Re: Moving Sidebox to Center Column

    Hi,
    Did you get this issue resoved and working in the centre column?
    Regards,
    Breda

  9. #9
    Join Date
    Sep 2010
    Posts
    263
    Plugin Contributions
    0

    red flag Re: Moving Sidebox to Center Column

    I want to do something similar to this also. i.e. I have this Magic SlideShow product that only outputs to the side boxes. Thus I want to move one of the side boxes ( Featured Products ) to the centre, just under the header image. I want the slide show to be more visible, so moving it to the centre and toward the top of the main page is my goal.

    Any ideas how to do this ?

  10. #10
    Join Date
    Apr 2007
    Location
    in the woods
    Posts
    9
    Plugin Contributions
    0

    Default Re: Moving Sidebox to Center Column

    Am trying to do a similar thing here, though I am trying to put it in its own div just below the center column.
    Using 1.3.9g and the Scrolling Featured Sidebox code I have modified the tpl_main_page.php to include

    $featuredHorizontal_template = 'tpl_featuredHorizontal.php';

    at @ line 50, and added this @ around line 135 after "<?php
    /**
    * prepares and displays center column
    *
    */
    require($body_code);
    ?>":

    <div class="centerColumn" id="scrollBox">
    <?php
    /* prepares and displays scrolling output */

    require($template->get_template_dir('tpl_featuredHorizontal.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_featuredHorizontal.php');

    ?>
    </div>


    Then I modified the scrolling tpl_featured.php to scroll left and named it tpl_featuredHorizontal.php, putting it in my_template/common folder and made necessary additions to the css file.

    So.... it is not working, any advice about what I'm doing wrong?

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Moving sidebox headers off center
    By CaroleAs in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 10 Nov 2010, 12:45 AM
  2. how do i move sidebox content to grid colum / column in center column
    By Mrchristoh in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 17 May 2009, 04:03 PM
  3. Manufacturer Info Sidebox to Single Column Center Box?
    By wasana in forum General Questions
    Replies: 0
    Last Post: 16 Jul 2007, 01:47 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