Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Issues with adding sidebox to main page

Issues with adding sidebox to main page

Locked

Views: 1,856

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
8 Apr 2007, 3:36 PM
#1
pinpinpin avatar

pinpinpin

New Zenner

Join Date:
Apr 2007
Posts:
3
Plugin Contributions:
0

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. :)

16 Oct 2009, 9:12 PM
#2
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Issues with adding sidebox to main page

Pinpinpin did not share how he resolved this:censored:.. 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/barstore/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:

 
<?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:
 
<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\*\*\[/COLOR\]](http://www.zen-cart.com/forum/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**
:frusty:I am almost there.. I am hoping someone can give me a nudge to get me over the finish line with this..
[COLOR=white]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
> **pinpinpin:**
>
> 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. :)
17 Oct 2009, 3:25 PM
#3
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Issues with adding sidebox to main page

Answering my own question..:laugh::laugh:

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)

  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:
<?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'); } ?>

I added it around line 42 to put it just below the defined page code as follows:
<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