Jump to content
Sign in to follow this  
imintrouble

Show/Hide Columns Infoboxes Support

Recommended Posts

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 by imintrouble

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 by choosealogin

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
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'); } ?>

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 ;)

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×