Forums / Templates, Stylesheets, Page Layout / Position categories sidebox differently to rest of site

Position categories sidebox differently to rest of site

Views: 521

Results 1 to 7 of 7
16 Aug 2013, 2:20 PM
#1
annie_zaz avatar

annie_zaz

Zen Follower

Join Date:
Mar 2013
Location:
Sydney, Australia
Posts:
140
Plugin Contributions:
0

Position categories sidebox differently to rest of site

I have re-positioned the categories sidebox (using css) so that it sits under the slideshow on the main page.
Attachment 12897
However on the rest of the site I want the categories sidebox to sit under the navigation bar.
At present its sitting in the same position as home page.
Attachment 12898
I have been playing around with custom/common/tpl_box_default_left.php
and given leftBoxContainer another class called leftBoxContainerIndex and added this css class (see below)

.leftBoxContainerIndex{position:relative;
top:303px;
left:0px;
margin: 0em;
border: 1px solid #9a9a9a;
border-bottom: 5px solid #000000;
margin-top: 1.5em;
}

Also I have tried putting another div in tpl_box_default_left.php like below, but that creates a duplicate categories box below existing categories box.

<!--// bof: <?php echo $box_id; ?> //--> <div class="leftBoxContainer" id="<?php echo str_replace('_', '-', $box_id ); ?>" style="width: <?php echo $column_width; ?>"> <div class="leftBoxContainerIndex" id="<?php echo str_replace('_', '-', $box_id ); ?>" style="width: <?php echo $column_width; ?>"> <h3 class="leftBoxHeading" id="<?php echo str_replace('_', '-', $box_id) . 'Heading'; ?>"><?php echo $title; ?></h3> <?php echo $content; ?> </div> <!--// eof: <?php echo $box_id; ?> //-->

Any help would be appreciated.

16 Aug 2013, 4:14 PM
#2
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Position categories sidebox differently to rest of site

Annie_zaz:

I have re-positioned the categories sidebox (using css) so that it sits under the slideshow on the main page.
Attachment 12897
However on the rest of the site I want the categories sidebox to sit under the navigation bar.
At present its sitting in the same position as home page.
Attachment 12898
I have been playing around with custom/common/tpl_box_default_left.php
and given leftBoxContainer another class called leftBoxContainerIndex and added this css class (see below)

.leftBoxContainerIndex{position:relative;
top:303px;
left:0px;
margin: 0em;
border: 1px solid #9a9a9a;
border-bottom: 5px solid #000000;
margin-top: 1.5em;
}

Also I have tried putting another div in tpl_box_default_left.php like below, but that creates a duplicate categories box below existing categories box.

<!--// bof: <?php echo $box_id; ?> //--> <div class="leftBoxContainer" id="<?php echo str_replace('_', '-', $box_id ); ?>" style="width: <?php echo $column_width; ?>"> <div class="leftBoxContainerIndex" id="<?php echo str_replace('_', '-', $box_id ); ?>" style="width: <?php echo $column_width; ?>"> <h3 class="leftBoxHeading" id="<?php echo str_replace('_', '-', $box_id) . 'Heading'; ?>"><?php echo $title; ?></h3> <?php echo $content; ?> </div> <!--// eof: <?php echo $box_id; ?> //-->

Any help would be appreciated.

You could move the slideshow to your header file at the bottom before the closing div and include and if statement to only include on home page.

16 Aug 2013, 10:57 PM
#3
annie_zaz avatar

annie_zaz

Zen Follower

Join Date:
Mar 2013
Location:
Sydney, Australia
Posts:
140
Plugin Contributions:
0

Re: Position categories sidebox differently to rest of site

rbarbour:

You could move the slideshow to your header file at the bottom before the closing div and include and if statement to only include on home page.

Thanks for your post rbarbour.
Do you mean to paste the below code into the bottom of tpl_header.php? I am unsure how to connect the if statement. I am still learning the PHP ropes.

<!-- bof Easy Slider 1.7 --> <div id="container"> <div id="content"> <div id="slider"> <ul> <li><a href="#"><img alt="Easy Slider 1.7 for Zen Cart" src="includes/templates/classic/images/slider1.jpg" /></a> <li><a href="#"><img alt="Easy Slider 1.7 for Zen Cart" src="includes/templates/classic/images/slider2.jpg" /></a> <li><a href="#"><img alt="Easy Slider 1.7 for Zen Cart" src="includes/templates/classic/images/slider3.jpg" /></a> <li><a href="#"><img alt="Easy Slider 1.7 for Zen Cart" src="includes/templates/classic/images/slider4.jpg" /></a> </li></ul> </div> </div> </div> <!-- eof Easy Slider 1.7 -->

Thanks rbarour please stay with me on this :smile:

17 Aug 2013, 12:01 AM
#4
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Position categories sidebox differently to rest of site

Annie_zaz:

Thanks for your post rbarbour.
Do you mean to paste the below code into the bottom of tpl_header.php? I am unsure how to connect the if statement. I am still learning the PHP ropes.

<!-- bof Easy Slider 1.7 --> <div id="container"> <div id="content"> <div id="slider"> <ul> <li><a href="#"><img alt="Easy Slider 1.7 for Zen Cart" src="includes/templates/classic/images/slider1.jpg" /></a> <li><a href="#"><img alt="Easy Slider 1.7 for Zen Cart" src="includes/templates/classic/images/slider2.jpg" /></a> <li><a href="#"><img alt="Easy Slider 1.7 for Zen Cart" src="includes/templates/classic/images/slider3.jpg" /></a> <li><a href="#"><img alt="Easy Slider 1.7 for Zen Cart" src="includes/templates/classic/images/slider4.jpg" /></a> </li></ul> </div> </div> </div> <!-- eof Easy Slider 1.7 -->

Thanks rbarour please stay with me on this :smile:

Yes, I would move it to ( /includes/templates/YOUR_TEMPLATE_NAME/common/tpl_header.php ) file

place it all the way at the bottom right before the last </div> or after <!--eof-header ezpage links-->

then add:

<?php if ($this_is_home_page) { ?> <!-- bof Easy Slider 1.7 --> <div id="container"> <div id="content"> <div id="slider"> <ul> <li><a href="#"><img alt="Easy Slider 1.7 for Zen Cart" src="includes/templates/classic/images/slider1.jpg" /></a> <li><a href="#"><img alt="Easy Slider 1.7 for Zen Cart" src="includes/templates/classic/images/slider2.jpg" /></a> <li><a href="#"><img alt="Easy Slider 1.7 for Zen Cart" src="includes/templates/classic/images/slider3.jpg" /></a> <li><a href="#"><img alt="Easy Slider 1.7 for Zen Cart" src="includes/templates/classic/images/slider4.jpg" /></a> </li></ul> </div> </div> </div> <!-- eof Easy Slider 1.7 --> <?php }?>
18 Aug 2013, 2:05 AM
#5
annie_zaz avatar

annie_zaz

Zen Follower

Join Date:
Mar 2013
Location:
Sydney, Australia
Posts:
140
Plugin Contributions:
0

Re: Position categories sidebox differently to rest of site

That did the trick. Thanks so much! :D
Just one parting question. How does the zc know that this variable or parameter is for the home page? $this_is_home_page
if I had written $this_is_index_page would it still understand?

18 Aug 2013, 3:28 AM
#6
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Position categories sidebox differently to rest of site

The variable $this_is_home_page is set to true (by Zen Cart's internal processing) if you are on the home page, otherwise it is false. There is no variable named $this_is_index_page.

18 Aug 2013, 12:08 PM
#7
annie_zaz avatar

annie_zaz

Zen Follower

Join Date:
Mar 2013
Location:
Sydney, Australia
Posts:
140
Plugin Contributions:
0

Re: Position categories sidebox differently to rest of site

OK. Thanks very much for enlightening me.:smile: