Results 1 to 3 of 3

Hybrid View

  1. #1
    Join Date
    Apr 2007
    Posts
    3
    Plugin Contributions
    0

    Default Issues with adding sidebox to main page

    I've been through many (many!) threads and posts regarding sideboxes, but I can't seem to find a solution to my problem. I've downloaded the "News Box" sidebox and it works fine. However, I need to appear in the main page and not the left/right columns. So far, I have managed to get it to appear, but it is under a generic "sideBox" class instead of its own "newsBox" class.

    I am using what was posted here: http://www.zen-cart.com/forum/showthread.php?t=30940 to add the sidebox into the main page.

    Any suggestions?

    Much thanks in advance!

    ------------

    Um, I think I might have found my own answer. :)
    Last edited by pinpinpin; 8 Apr 2007 at 04:42 PM.

  2. #2
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Including Sidebox Content on Index Page Template

    Pinpinpin did not share how he resolved this.. While I REALLY hate to bump such an old post, I do need to bump this one. This was the only post which gave me a clue as to how I MIGHT to do this...

    Here's the proposed template for the site I am working on.
    http://greentieworks.com/clientele/b...e/barstore.png
    On the front page we'd really like to add the news sidebox content to the home page.

    I have figured out how to make the suggestion from the post referenced below to work on some of my defined pages. However, I am stumped how to add it to the main page.. and I KNOW it is something obvious that I am overlooking..

    If I am right, I would add this code to the YOUR_TEMPLATE/templates/tpl_index_default.php file..

    The problem is I am not quite sure where to place this, and I keep getting an error which I need help resolving before I worry about where in the file to put this code.

    So here's what's happening:
    I copied this code:
    Code:
     
    <?php  if ( file_exists(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/search.php') ) {
     require(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/search.php');
      } else {
     require(DIR_WS_MODULES . 'sideboxes/search.php');
      }
    ?>
    into the YOUR_TEMPLATE/templates/tpl_index_default.php file right around line 42 as follows:

    Code:
     
    <div id="indexDefaultMainContent" class="content"><?php require($define_page); ?></div>
    <?php } ?>
    <?php  if ( file_exists(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/search.php') ) {
    require(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/search.php');
    } else {
    require(DIR_WS_MODULES . 'sideboxes/search.php');
    }
    ?>
    but I get this error
    Warning: require(includes/templates/custom_template/common/) [function.require]: failed to open stream: No such file or directory in /home/content/o/v/e/USER_NAME/html/DOMAIN/SUB_FOLDER/includes/modules/sideboxes/search.php on line 16
    I am almost there.. I am hoping someone can give me a nudge to get me over the finish line with this..
    Including Sidebox Content on Index Page Template
    Adding Sidebox Content on Index Page Template
    Sidebox Content on Index Page Template
    Including Sidebox Content on Main Page
    Adding Sidebox Content on Main Page
    Sidebox Content on Main Page
    Add Sidebox to Main Page
    Quote Originally Posted by pinpinpin View Post
    I've been through many (many!) threads and posts regarding sideboxes, but I can't seem to find a solution to my problem. I've downloaded the "News Box" sidebox and it works fine. However, I need to appear in the main page and not the left/right columns. So far, I have managed to get it to appear, but it is under a generic "sideBox" class instead of its own "newsBox" class.

    I am using what was posted here: http://www.zen-cart.com/forum/showthread.php?t=30940 to add the sidebox into the main page.

    Any suggestions?

    Much thanks in advance!

    ------------

    Um, I think I might have found my own answer. :)
    Last edited by DivaVocals; 16 Oct 2009 at 10:18 PM.

  3. #3
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Including Sidebox Content on Index Page Template

    Answering my own question..

    Okay.. I shoulda tried this on a FRESH Zen install.. So I confirmed my changes worked.. But it doesn't work when the sideboxes are turned off on the Zen Cart home page (YOUR_TEMPLATE/common/tpl_main_page.php). If the sideboxes are turned off on the home page NOTHING shows up below the defined main page text (including the EZ Pages footer)
    Code:
      if ($this_is_home_page) {
         $flag_disable_left = true;
      }
        if ($this_is_home_page) {
         $flag_disable_right = true;
      }
    So to recap: I've added the sidebox to the main page using this code
    Add this following:
    Code:
     
    <?php  if ( file_exists(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/search.php') ) {
     require(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/search.php');
      } else {
     require(DIR_WS_MODULES . 'sideboxes/search.php');
      }
    ?>
    to this file: YOUR_TEMPLATE/templates/tpl_index_default.php

    I added it around line 42 to put it just below the defined page code as follows:
    Code:
     
    <div id="indexDefaultMainContent" class="content"><?php require($define_page); ?></div>
    <?php } ?>
    <?php  if ( file_exists(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/search.php') ) {
    require(DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/search.php');
    } else {
    require(DIR_WS_MODULES . 'sideboxes/search.php');
    }
    ?>
    This gets the sidebox to showup on the home page, but only if the sideboxes are not turned off on the home page.. If the sideboxes are turned off on the home page NOTHING shows up below the defined main page text (including the EZ Pages footer)

    Anybody got any ideas how to proceed??
    Including Sidebox Content on Index Page Template
    Adding Sidebox Content on Index Page Template
    Sidebox Content on Index Page Template
    Including Sidebox Content on Main Page
    Adding Sidebox Content on Main Page
    Sidebox Content on Main Page
    Add Sidebox to Main Page
    Last edited by DivaVocals; 17 Oct 2009 at 04:31 PM.

 

 

Similar Threads

  1. v150 Issues with adding 'Page_5' to the More Information Sidebox
    By In2Deep in forum Addon Sideboxes
    Replies: 6
    Last Post: 7 May 2013, 08:04 PM
  2. Products dont appear on the main page and issues with magicmagnify
    By aerografiks in forum General Questions
    Replies: 1
    Last Post: 19 Mar 2009, 03:50 AM
  3. Need some expert help with a couple of main page issues!
    By debtag in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 5 Mar 2008, 02:26 AM
  4. Main Page issues
    By bluejay74 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 9 Oct 2007, 01:34 PM
  5. Replace sidebox with image on main page
    By magicpants in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 15 May 2006, 12:49 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