Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Removing sideboxes from defines page

Removing sideboxes from defines page

Locked

Views: 2,392

Results 1 to 16 of 16
This thread is locked. New replies are disabled.
11 Jun 2008, 3:42 AM
#1
ctcentralinfo avatar

ctcentralinfo

Totally Zenned

Join Date:
Apr 2005
Posts:
853
Plugin Contributions:
0

Removing sideboxes from defines page

I created a defines page called all departments, and I am trying to remove the sideboxes. I was wondering if their was away to remove the sideboxes from this defines page.

11 Jun 2008, 3:55 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Removing sideboxes from defines page

If you look in tpl_main_page.php you'll see comments in the code which explain how to disable left or right columns based on the name of the page being displayed.

11 Jun 2008, 6:05 AM
#3
ctcentralinfo avatar

ctcentralinfo

Totally Zenned

Join Date:
Apr 2005
Posts:
853
Plugin Contributions:
0

Re: Removing sideboxes from defines page

Followed the instructions and it didn't work. I copied tpl_main_page.php to includes/template/MY_TEMPLATE/all departments/tpl_main_page.php then I commented this section:

<?php /** * Common Template - tpl_main_page.php * * Governs the overall layout of an entire page<br /> * Normally consisting of a header, left side column. center column. right side column and footer<br /> * For customizing, this file can be copied to /templates/your_template_dir/pagename<br /> * example: to override the privacy page<br /> * - make a directory /templates/my_template/privacy<br /> * - copy /templates/templates_defaults/common/tpl_main_page.php to /templates/my_template/privacy/tpl_main_page.php<br /> * <br /> * to override the global settings and turn off columns un-comment the lines below for the correct column to turn off<br /> * to turn off the header and/or footer uncomment the lines below<br /> * Note: header can be disabled in the tpl_header.php<br /> * Note: footer can be disabled in the tpl_footer.php<br /> * <br /> * $flag_disable_header = true;<br /> $flag_disable_left = true;<br /> $flag_disable_right = true;<br /> * $flag_disable_footer = true;<br /> * <br /> * // example to not display right column on main page when Always Show Categories is OFF<br /> * <br /> * if ($current_page_base == 'index' and $cPath == '') {<br /> * $flag_disable_right = true;<br /> * }<br /> * <br /> * example to not display right column on main page when Always Show Categories is ON and set to categories_id 3<br /> * <br /> * if ($current_page_base == 'index' and $cPath == '' or $cPath == '3') {<br /> * $flag_disable_right = true;<br /> * }<br /> * * @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_main_page.php 7085 2007-09-22 04:56:31Z ajeh $ */
11 Jun 2008, 6:23 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Removing sideboxes from defines page

The section you quoted is the instructions.
The actual code to change occurs further down, after the comments are done.

11 Jun 2008, 6:38 AM
#5
gjh42 avatar

gjh42

Black Belt

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

Re: Removing sideboxes from defines page

The space in /all departments/ may be causing problems - depending on exactly how your page name is translating into code. Some systems don't like spaces in filepaths.

The way you uncommented the $flag statements definitely does not work. You need to close the comment tag and then reopen it after the statements (

  • Note: footer can be disabled in the tpl_footer.php<br />
  • <br />
  • $flag_disable_header = true;<br />
    /
    $flag_disable_left = true;
    $flag_disable_right = true;
    /
  • $flag_disable_footer = true;<br />
  • <br />
  • // example to not display right column
    )

or else just copy the statements to a place in php code outside the head comments.

There is another way of achieving your goal beside a page-specific copy of the file: use an "if" statement to act when on the desired page.

if ($current_page_base == 'all_departments') { //(or whatever the correct technical name is)
  $flag_disable_left = true;
  $flag_disable_right = true;
}
11 Jun 2008, 1:22 PM
#6
ctcentralinfo avatar

ctcentralinfo

Totally Zenned

Join Date:
Apr 2005
Posts:
853
Plugin Contributions:
0

Re: Removing sideboxes from defines page

DrByte:

The section you quoted is the instructions.
The actual code to change occurs further down, after the comments are done.

So which section do I edit exactly? The instructions don't seem to match what I am seeing:

<?php /** * Common Template - tpl_main_page.php * * Governs the overall layout of an entire page<br /> * Normally consisting of a header, left side column. center column. right side column and footer<br /> * For customizing, this file can be copied to /templates/your_template_dir/pagename<br /> * example: to override the privacy page<br /> * - make a directory /templates/my_template/privacy<br /> * - copy /templates/templates_defaults/common/tpl_main_page.php to /templates/my_template/privacy/tpl_main_page.php<br /> * <br /> * to override the global settings and turn off columns un-comment the lines below for the correct column to turn off<br /> * to turn off the header and/or footer uncomment the lines below<br /> * Note: header can be disabled in the tpl_header.php<br /> * Note: footer can be disabled in the tpl_footer.php<br /> * <br /> * $flag_disable_header = true;<br /> * $flag_disable_left = true;<br /> * $flag_disable_right = true;<br /> * $flag_disable_footer = true;<br /> * <br /> * // example to not display right column on main page when Always Show Categories is OFF<br /> * <br /> * if ($current_page_base == 'index' and $cPath == '') {<br /> * $flag_disable_right = true;<br /> * }<br /> * <br /> * example to not display right column on main page when Always Show Categories is ON and set to categories_id 3<br /> * <br /> * if ($current_page_base == 'index' and $cPath == '' or $cPath == '3') {<br /> * $flag_disable_right = true;<br /> * }<br /> * * @package templateSystem * @copyright Copyright 2003-2006 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_main_page.php 4886 2006-11-05 09:01:18Z drbyte $ */ // the following IF statement can be duplicated/modified as needed to set additional flags if (in_array($current_page_base,explode(",",'list_pages_to_skip_all_right_sideboxes_on_here,separated_by_commas,and_no_spaces')) ) { $flag_disable_right = true; } $header_template = 'tpl_header.php'; $footer_template = 'tpl_footer.php'; $left_column_file = 'column_left.php'; $right_column_file = 'column_right.php'; $body_id = ($this_is_main_page) ? 'indexHome' : str_replace('_', '', $_GET['main_page']); ?> <body id="<?php echo $body_id . 'Body'; ?>"<?php if($zv_onload !='') echo ' onload="'.$zv_onload.'"'; ?>> <?php if (SHOW_BANNERS_GROUP_SET1 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET1)) { if ($banner->RecordCount() > 0) { ?> <div id="bannerOne" class="banners"><?php echo zen_display_banner('static', $banner); ?></div> <?php } } ?> <div id="mainWrapper"> <?php /** * prepares and displays header output * */ require($template->get_template_dir('tpl_header.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_header.php');?> <table width="100%" border="0" cellspacing="0" cellpadding="0" id="contentMainWrapper"> <tr> <?php if (COLUMN_LEFT_STATUS == 0 or (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == '')) { // global disable of column_left $flag_disable_left = true; } if (!isset($flag_disable_left) || !$flag_disable_left) { ?> <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 } ?> <td valign="top"> <!-- bof breadcrumb --> <?php if (DEFINE_BREADCRUMB_STATUS == '1' || (DEFINE_BREADCRUMB_STATUS == '2' && !$this_is_home_page) ) { ?> <div id="navBreadCrumb"><?php echo $breadcrumb->trail(BREAD_CRUMBS_SEPARATOR); ?></div> <?php } ?> <!-- eof breadcrumb --> <?php if (SHOW_BANNERS_GROUP_SET3 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET3)) { if ($banner->RecordCount() > 0) { ?> <div id="bannerThree" class="banners"><?php echo zen_display_banner('static', $banner); ?></div> <?php } } ?> <!-- bof upload alerts --> <?php if ($messageStack->size('upload') > 0) echo $messageStack->output('upload'); ?> <!-- eof upload alerts --> <?php /** * prepares and displays center column * */ require($body_code); ?> <?php if (SHOW_BANNERS_GROUP_SET4 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET4)) { if ($banner->RecordCount() > 0) { ?> <div id="bannerFour" class="banners"><?php echo zen_display_banner('static', $banner); ?></div> <?php } } ?></td> <?php if (COLUMN_RIGHT_STATUS == 0 or (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == '')) { // global disable of column_right $flag_disable_right = true; } if (!isset($flag_disable_right) || !$flag_disable_right) { ?> <td id="navColumnTwo" class="columnRight" style="width: <?php echo COLUMN_WIDTH_RIGHT; ?>"> <?php /** * prepares and displays right column sideboxes * */ ?> <div id="navColumnTwoWrapper" style="width: <?php echo BOX_WIDTH_RIGHT; ?>"><?php require(DIR_WS_MODULES . zen_get_module_directory('column_right.php')); ?></div></td> <?php } ?> </tr> </table> <?php /** * prepares and displays footer output * */ require($template->get_template_dir('tpl_footer.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_footer.php');?> </div> <!--bof- parse time display --> <?php if (DISPLAY_PAGE_PARSE_TIME == 'true') { ?> <div class="smallText center">Parse Time: <?php echo $parse_time; ?> - Number of Queries: <?php echo $db->queryCount(); ?> - Query Time: <?php echo $db->queryTime(); ?></div> <?php } ?> <!--eof- parse time display --> <!--bof- banner #6 display --> <?php if (SHOW_BANNERS_GROUP_SET6 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET6)) { if ($banner->RecordCount() > 0) { ?> <div id="bannerSix" class="banners"><?php echo zen_display_banner('static', $banner); ?></div> <?php } } ?> <!--eof- banner #6 display --> </body>
11 Jun 2008, 3:15 PM
#7
gjh42 avatar

gjh42

Black Belt

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

Re: Removing sideboxes from defines page

Did you read my post?

11 Jun 2008, 4:59 PM
#8
ctcentralinfo avatar

ctcentralinfo

Totally Zenned

Join Date:
Apr 2005
Posts:
853
Plugin Contributions:
0

Re: Removing sideboxes from defines page

gjh42:

Did you read my post?

It didn't work, that is why I am posting my question.

11 Jun 2008, 5:49 PM
#9
gjh42 avatar

gjh42

Black Belt

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

Re: Removing sideboxes from defines page

One or the other of the steps I posted will work, if you have the correct name/filename/$current_page_base for your page. Exactly what is the define page filename, or what does the address bar say when you are on the page?

11 Jun 2008, 7:40 PM
#10
ctcentralinfo avatar

ctcentralinfo

Totally Zenned

Join Date:
Apr 2005
Posts:
853
Plugin Contributions:
0

Re: Removing sideboxes from defines page

gjh42:

Did you read my post?

gjh42:

One or the other of the steps I posted will work, if you have the correct name/filename/$current_page_base for your page. Exactly what is the define page filename, or what does the address bar say when you are on the page?

Turns out that I put the file in the wrong folder works now, thanks. Now I need to figure out how to remove the back button.

11 Jun 2008, 7:46 PM
#11
gjh42 avatar

gjh42

Black Belt

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

Re: Removing sideboxes from defines page

You should be able to hide it with CSS, specific to the page id. A link to the page or site in question will make it easier to give good advice.

26 Jun 2008, 11:07 AM
#12
burko avatar

burko

New Zenner

Join Date:
May 2008
Location:
Sydney
Posts:
17
Plugin Contributions:
0

Re: Removing sideboxes from defines page

I am attempting to remove both sideboxes for my shopping cart and checkout pages.

I have put the following lines in my tpl_shopping_cart_default.php and the tpl_checkout_confirmation_default.php.

$flag_disable_left = true;
$flag_disable_right = true;

The left sideboxes do not disappear but the right ones do, any suggestions?

Thankyou

26 Jun 2008, 3:38 PM
#13
gjh42 avatar

gjh42

Black Belt

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

Re: Removing sideboxes from defines page

I expect that those files are being called when the center column is processed, after the left column is output, so the flags there can't affect the left column.

You need to put the flags in tpl_main_page.php, either in a page-specific subdirectory copy as DrByte mentioned at the top of the thread, or in a conditional statement that operates on the value of $current_page_base.

6 Jul 2008, 11:00 AM
#14
burko avatar

burko

New Zenner

Join Date:
May 2008
Location:
Sydney
Posts:
17
Plugin Contributions:
0

Re: Removing sideboxes from defines page

Thanks for your assistance, that worked.

26 Oct 2008, 6:47 AM
#15
meltdown avatar

meltdown

Totally Zenned

Join Date:
Jun 2006
Location:
My family and I live in Brighton, England
Posts:
947
Plugin Contributions:
0

Re: Removing sideboxes from defines page

Hmmm... Following this advice I was able to remove the sideboxes from a specific page. However, as you can see the dead space associated with the sidebox is still in place. Can you tell me how to make the entire page available?

FYI: I'm running the Apple Zen template with left-side-only sideboxes, although I did need to define both left & right if statement for it to work:

if ($current_page_base == 'page_3') { //(or whatever the correct technical name is)
  $flag_disable_left = true;
  $flag_disable_right = true;
}

Thanks!

27 Oct 2008, 6:00 AM
#16
gjh42 avatar

gjh42

Black Belt

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

Re: Removing sideboxes from defines page

It looks like there are two separate things that are causing this. The center column is specified to stay to the right, and paragraphs are given a fixed width as well.

.centerColumn { 	
background:#E0FFA0;
width:75%; 	/*these 2 lines keep the center column to the right 75% of the space*/
float:right; 	
margin:0 2% 2% 3%; 	
text-align:left; 	
line-height:1.6em; 	
display:inline; /* fixes IE Bug in IE6 and earlier - do not remove */ 	}


#content p {
		 width: 460px;
		 color: #000;
		 font-size: 0.7em;
		 margin-left: 20px;
		 font-weight: normal;} 
```This is a delicately woven template, and it will require some targeted conditional styling to make it flex as you wish. A per-page stylesheet with the correct rules to undo the above will probably work.