Guest Posted May 12, 2006 Share Posted May 12, 2006 (edited) Show or Hide Left or Right columns Basically a simple hack If you want to hide your left column edit the index.php page like this.. <!-- left_navigation //--> <?php if($PHP_SELF == '/index.php' AND $HTTP_GET_VARS[cPath] == NULL){ }else{ require(DIR_WS_INCLUDES . 'column_left.php'); }; ?> <!-- left_navigation_eof //--> You can change the cPath part of it to hide the left column if it's in a certain category. or you can hide the right column instead or you can just go into your left or right column php file and show/hide specific infoboxes based on whether your on a specific page or not. by just putting if($PHP_SELF =='/index.php' AND $HTTP_GET_VARS[cPath]==NULL){ }else{ require(DIR_WS_INCLUDES . 'theinfobox.php'); You can change the cPath value to show or hide based on a specific path also. If any of you master programmers out there can tweak this more feel free. This is my first contrib guys so go easy on me.. Oh, I almost forgot link to the contrib is Show/Hide Columns/Infoboxes Edited May 12, 2006 by imintrouble Quote Link to comment Share on other sites More sharing options...
Guest Posted May 16, 2006 Share Posted May 16, 2006 Update: Anyone want to try and see if this also works? <?php if ( basename($_SERVER['PHP_SELF']) == FILENAME_DEFAULT && $current_category_id == 'NULL' ){ }else{ require(DIR_WS_INCLUDES . 'column_left.php'); }; ?> instead of this? <?php if($PHP_SELF == '/index.php' AND $HTTP_GET_VARS[cPath] == NULL){ }else{ require(DIR_WS_INCLUDES . 'column_left.php'); }; ?> Quote Link to comment Share on other sites More sharing options...
NextLevelMotoring Posted May 16, 2006 Share Posted May 16, 2006 Can you give a little bit more info about where the code goes in index.php? I'm trying to have only column_left and eliminate the right column Quote Link to comment Share on other sites More sharing options...
choosealogin Posted May 16, 2006 Share Posted May 16, 2006 (edited) Actually, what imintrouble is referring to would only help you if you wanted to hide certain boxes or columns under specific conditions and show them at other times. It sounds like you want to eliminate the right column completely. Is that correct? If so, you'll need to edit every root level file (index, product_info, shopping_cart, account_info, reviews, etc, etc, etc, etc, etc). There are about 40 files to edit (every page that shows a right column). To eliminate the right column, find: <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- right_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?> <!-- right_navigation_eof //--> </table></td> in each of those files and remove it. It's about 2/3 of the way down, if my memory is correct. Can you give a little bit more info about where the code goes in index.php? I'm trying to have only column_left and eliminate the right column Edited May 16, 2006 by choosealogin Quote Link to comment Share on other sites More sharing options...
Guest Posted May 18, 2006 Share Posted May 18, 2006 Choose a login is right in order to hide the right column entirely you'll have to edit about 40 pages, unless you use one of the template systems. Like STS or BTS Quote Link to comment Share on other sites More sharing options...
johnson4 Posted May 18, 2006 Share Posted May 18, 2006 I have a catalog being shown in i-frames on 2 different sites, and on one site I would like the left column to never appear. Do you know a way to detect the location of the catalog, so that the php will hide the left column if the catalog is being viewed in site 1 and show the left column if the catalog is being viewed in site 2? Thanks for any help with this, sj Quote Link to comment Share on other sites More sharing options...
Guest Posted August 23, 2006 Share Posted August 23, 2006 Can you give a little bit more info about where the code goes in index.php? I'm trying to have only column_left and eliminate the right column You wrap the code around the column_right php if that's where you want to use it. In other words.. Find this code.. <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- right_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?> <!-- right_navigation_eof //--> </table></td> On your index.php page. Replace it with.. <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- right_navigation //--> <?php if ( basename($_SERVER['PHP_SELF']) == FILENAME_DEFAULT && $current_category_id == 'NULL' ){ }else{ require(DIR_WS_INCLUDES . 'column_right.php'); }; ?> <!-- right_navigation_eof //--> </table></td> Unless you want to entirely remove just edit all of the pages by commenting out the column right like this.. <?php //require(DIR_WS_INCLUDES . 'column_right.php'); } ?> Quote Link to comment Share on other sites More sharing options...
tec Posted September 21, 2007 Share Posted September 21, 2007 i hope this thread is still active :) ok, what if i want an info box to show in the left column called animals.php (custom infobox) but i dont want it to show on any other pages? i dont want an infobox to replace it on any other page, i just want this one box to only show on the index.php Quote Link to comment Share on other sites More sharing options...
tec Posted September 21, 2007 Share Posted September 21, 2007 haha, the most obvious always gos unnoticed doesnt it? i was able to get my desired result by simply adding an includes tag to the index.php file for the one info box i wanted to show on only that page ;) Quote Link to comment Share on other sites More sharing options...
tec Posted September 21, 2007 Share Posted September 21, 2007 hmm..i had a feeling that was too easy...seems i do not quite have it yet, as the info box is still showing up on my category pages.....how do i set it to ONLY show on the main index.php? Quote Link to comment Share on other sites More sharing options...
tec Posted September 21, 2007 Share Posted September 21, 2007 got it in includes/colum_left.php // bof infobox on index only if (isset($HTTP_GET_VARS['products_id'])) { } else { if (isset($cPath) && tep_not_null($cPath)) { } else { include(DIR_WS_BOXES . 'animals.php'); } } //eof infobox on index only Quote Link to comment Share on other sites More sharing options...
gregy Posted November 29, 2007 Share Posted November 29, 2007 hmm .. what code should i put in if i want specific infobox on specific page .. i.e. login.php would show in column_right.php a login_infobox.php file ? Thanks for your help! Quote Link to comment Share on other sites More sharing options...
koalaphil Posted December 2, 2007 Share Posted December 2, 2007 Sort of on same topic, I don't want to eliminate entitre side just the information box and its contents i tried in information .php to remove the contents by removing the lines after href but this removed evertything except the catalog so i had to reinstall information.php from my backup. Anyhelp would be greatly appreciated. koalaphil Quote Link to comment Share on other sites More sharing options...
sarah.j Posted February 9, 2008 Share Posted February 9, 2008 Hi, I have a problem with quite the same contribution, i.e. lemme show you the code I did put to hide the right column in the index when cPath is not selected : [b]<?php if (isset($cPath_array)) { if ($cPath_array[0] == 1)?>[/b] <td class="colonnedroite" width="<?php echo BOX_WIDTH; ?>" valign="top"> <table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- right_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?> <!-- right_navigation_eof //--> [b]<?php } ?>[/b] </table> But I did not think about the manufacturers ! I mean the column doesn't show when I select only a manufacturer since cPath "does not exist". Can someone tell me how to complete the code in order to have the column on both cPath and manufacturers selection ? Thanks a lot. Quote Link to comment Share on other sites More sharing options...
leveera Posted March 7, 2008 Share Posted March 7, 2008 Also looking for code what display box on the certan page only. The code below removes box only in categories but it still display on the contact_us, shippment, conditions ets pages. Any help, please! Sergei got it in includes/colum_left.php // bof infobox on index only if (isset($HTTP_GET_VARS['products_id'])) { } else { if (isset($cPath) && tep_not_null($cPath)) { } else { include(DIR_WS_BOXES . 'animals.php'); } } //eof infobox on index only Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.