Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / home page only sidebox

home page only sidebox

Locked

Views: 5,573

Results 21 to 28 of 28
This thread is locked. New replies are disabled.
30 May 2009, 6:57 AM
#21
gjh42 avatar

gjh42

Black Belt

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

home page only sidebox

It would work for any sidebox, in the corresponding
/includes/modules/sideboxes/your_template/your_sidebox_name.php file.

If there is already an

if ($show_your_sidebox_name == true) {

test, you can just add the code shown above (modified to fit the filename).
If there is no test, you will have to add one with its curly braces { } surrounding the whole sidebox output code. Follow the example of the file shown here.

31 Aug 2009, 1:17 PM
#22
shrimp_gumbo_mmmhhh avatar

shrimp_gumbo_mmmhhh

Totally Zenned

Join Date:
Jun 2007
Location:
Texas, USA
Posts:
1,436
Plugin Contributions:
0

Re: home page only sidebox

Ajeh:

I was being literal there is a variable literally called:
$this_is_home_page

When on the Home page the variable:
$this_is_home_page

will be true ...

When not on the Home page the variable:
$this_is_home_page

will be false ...

Hello Ajeh,

Are there any variables for these pages:

shopping cart page
advanced search page

If you have any other literals for pages that would be great....

Thank you!

Shrimp

31 Aug 2009, 9:51 PM
#23
gjh42 avatar

gjh42

Black Belt

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

Re: home page only sidebox

The home page is the only one as far as I know. Other pages have unique names; the home page shares its name with all other index pages, so needed a distinguishing variable.
For other pages, you can use

if ($current_page_base == 'your_page_name'){
  //do something
}
12 Oct 2009, 1:38 AM
#24
shrimp_gumbo_mmmhhh avatar

shrimp_gumbo_mmmhhh

Totally Zenned

Join Date:
Jun 2007
Location:
Texas, USA
Posts:
1,436
Plugin Contributions:
0

Re: home page only sidebox

if ($current_page_base == 'checkout_shipping')
{
do nothing
}
else
{
do something
}

okay, I have the above code and put it into one of the /sideboxes tpl files.... everything looks good except that the sidebox "label" or header appears ..... is there somewhere else I need to put this code also?

Thanks!

Shrimp

12 Oct 2009, 1:46 AM
#25
shrimp_gumbo_mmmhhh avatar

shrimp_gumbo_mmmhhh

Totally Zenned

Join Date:
Jun 2007
Location:
Texas, USA
Posts:
1,436
Plugin Contributions:
0

Re: home page only sidebox

shrimp-gumbo-mmmhhh:

if ($current_page_base == 'checkout_shipping')
{
do nothing
}
else
{
do something
}

okay, I have the above code and put it into one of the /sideboxes tpl files.... everything looks good except that the sidebox "label" or header appears ..... is there somewhere else I need to put this code also?

Thanks!

Shrimp

I see this happening with search, categories, information, shopping_cart.... (sideboxes)

12 Oct 2009, 1:53 AM
#26
shrimp_gumbo_mmmhhh avatar

shrimp_gumbo_mmmhhh

Totally Zenned

Join Date:
Jun 2007
Location:
Texas, USA
Posts:
1,436
Plugin Contributions:
0

Re: home page only sidebox

Apparently...

includes/templates/template_default/common/tpl_box_default_left.php
and
includes/templates/template_default/common/tpl_box_default_right.php

play a role in the headers....

Now the question is... how do I get my "middle" to stretch and file both the left and the right columns?

Shrimp

12 Oct 2009, 3:02 AM
#27
shrimp_gumbo_mmmhhh avatar

shrimp_gumbo_mmmhhh

Totally Zenned

Join Date:
Jun 2007
Location:
Texas, USA
Posts:
1,436
Plugin Contributions:
0

Re: home page only sidebox

Okay... forget all the other files... if you do not want side boxes to show up at certain areas you can do it all from

/includes/templates/template_default/common/tpl_main_page.php

<?php if ($current_page_base == 'checkout_shipping') {//do nothing } else { ?> <td id="navColumnOne" class="columnLeft" style="width: <?php echo COLUMN_WIDTH_LEFT; ?>"> <?php /** * prepares and displays left column sideboxes * */ ?> <div id="navColumnOneWrapper" style="width: <?php echo BOX_WIDTH_LEFT; ?>"><?php require(DIR_WS_MODULES . zen_get_module_directory('column_left.php')); ?></div></td> <?php } } ?>

:clap:

12 Oct 2009, 11:38 AM
#28
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: home page only sidebox

shrimp-gumbo-mmmhhh:

if you do not want side boxes to show up at certain areas you can do it all from

/includes/templates/template_default/common/tpl_main_page.php
Important correction to the above:

/includes/templates/YOUR_TEMPLATE/common/tpl_main_page.php

Also, if you want to turn OFF the left and/or right Sideboxes entirely, for certain "named" pages, then use this type of code at the top of your "tpl_main_page.php"

> // the following IF statement can be duplicated/modified as needed to set additional flags

if (in_array($current_page_base,explode(",",'shopping_cart,checkout_shipping,checkout_payment,checkout_confirmation,checkout_success')) ) {
$flag_disable_left = true;
$flag_disable_right = true;
}