Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[WTA] Remove left n right coloum only at index / main page


staniwan

Recommended Posts

Posted

Can some one teach me how to remove the left / right coloum only at the main page / index ,

at index.php , if i remove the

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

it's effect all the category page , n product listing page.

 

Thank you

 

Sundi Taniwan

Posted

If you want to remove the left and right columns only on the top page (is that a good idea?), I think you need to test if index.php is being called as the top page or as something lower level (category or product display). I suspect that $category_depth would be the key.

 

Try changing

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </table></td>

and

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

to

<?php if ($category_depth != 'top') { ?>
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </table></td>
<?php } ?>

and

<?php if ($category_depth != 'top') { ?>
<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>
<?php } ?>

and see if it behaves like you want. If not, I have no idea.

Posted

@Biancoblu

the contribution will remove all the left n right column in all index , category , subcategory .

Thank you

 

If you want to remove the left and right columns only on the top page (is that a good idea?), I think you need to test if index.php is being called as the top page or as something lower level (category or product display). I suspect that $category_depth would be the key.

 

Try changing

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </table></td>

and

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

to

<?php if ($category_depth != 'top') { ?>
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </table></td>
<?php } ?>

and

<?php if ($category_depth != 'top') { ?>
<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>
<?php } ?>

and see if it behaves like you want. If not, I have no idea.

Problem Solved

this is great... this what i want. thx alot [MrPhil]

Posted
@Biancoblu

the contribution will remove all the left n right column in all index , category , subcategory .

Thank you

 

you're right, I misread your first post, my apologies.

~ Don't mistake my kindness for weakness ~

  • 3 months later...
Posted

If you want to remove the left and right columns only on the top page (is that a good idea?), I think you need to test if index.php is being called as the top page or as something lower level (category or product display). I suspect that $category_depth would be the key.

 

Try changing

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </table></td>

and

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

to

<?php if ($category_depth != 'top') { ?>
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </table></td>
<?php } ?>

and

<?php if ($category_depth != 'top') { ?>
<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>
<?php } ?>

and see if it behaves like you want. If not, I have no idea.

 

Great little bit of coding. Makes the world of difference. I have tried to do it on the login page, but can't seem to get it working. Is there some difference?

Posted

Great little bit of coding. Makes the world of difference. I have tried to do it on the login page, but can't seem to get it working. Is there some difference?

The login page is just one and there are no categories etc, so the "if" makes no sense there. To make the column disappear there you just change this

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

to this

<?php //require(DIR_WS_INCLUDES . 'column_left.php'); ?>

Posted

The login page is just one and there are no categories etc, so the "if" makes no sense there. To make the column disappear there you just change this

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

to this

<?php //require(DIR_WS_INCLUDES . 'column_left.php'); ?>

 

Done that, but I have a white section there now. I have used the help here to get rid of the entire column at index etc before:

 

http://www.oscommerce.com/forums/topic/347972-wta-remove-left-n-right-coloum-only-at-index-main-page/page__p__1453333__hl__remove%20right%20column__fromsearch__1entry1453333

Posted

Done that, but I have a white section there now. I have used the help here to get rid of the entire column at index etc before:

 

http://www.oscommerce.com/forums/topic/347972-wta-remove-left-n-right-coloum-only-at-index-main-page/page__p__1453333__hl__remove%20right%20column__fromsearch__1entry1453333

Well, I don't know what you want to have. You need to change the html of the page to change the look, ie to remove also the <td><table> ...... </table></td> of the left column or to replace it with something else, depends on what you want

Posted

Well, I don't know what you want to have. You need to change the html of the page to change the look, ie to remove also the <td><table> ...... </table></td> of the left column or to replace it with something else, depends on what you want

 

I worked it out. I had to remove this:

 

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

</tr>

</table>

 

Thanks for pointing me in the right direction.

Posted

I worked it out. I had to remove this:

 

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

</tr>

</table>

 

Thanks for pointing me in the right direction.

You removed too much. You removed also the closing </tr> and</table> that are opening at the beginning of the file.

 

In general everything that opens (<tr>) need to close (</tr>) and everything that close needs to open earlier. Thats basic. You can not remove just an opening or just a closing tag

Posted

You removed too much. You removed also the closing </tr> and</table> that are opening at the beginning of the file.

 

In general everything that opens (<tr>) need to close (</tr>) and everything that close needs to open earlier. Thats basic. You can not remove just an opening or just a closing tag

 

Is that going to cause me an issue? It did exactly what I wanted it to do?!

  • 1 month later...
Posted

Any ideas how to take the right column out of the sub-category sections? I've done it before, but can't work out how now! :(

Posted

Any ideas how to take the right column out of the sub-category sections? I've done it before, but can't work out how now! :(

 

I'm sure that before when I've done it that section got removed when I took it from the index.php, but not this time. There isn't a categories.php in the catalog though?

Posted

Can anybody shed some light on the above post please?

 

 

I was going to suggest a solution, but looking back phil has done that already, have you applied that? is that not working?

Posted

I was going to suggest a solution, but looking back phil has done that already, have you applied that? is that not working?

 

That's the thing. I have doen that and it worked on the first index page, but not on the sub-categories. It worked before like that, so I can't think of another work-around for it.

Posted

That's the thing. I have doen that and it worked on the first index page, but not on the sub-categories. It worked before like that, so I can't think of another work-around for it.

 

Right, I just tried taking that whole chunk of code out and it works. I left this in there still:

 

</tr>

</table>

Posted

Right, I just tried taking that whole chunk of code out and it works. I left this in there still:

 

</tr>

</table>

 

 

yes, George is right, you must keep a valid structure, are you not familiar with how html tables must be created or modified?

 

 

Is everything working OK now? B)

Posted

yes, George is right, you must keep a valid structure, are you not familiar with how html tables must be created or modified?

 

 

Is everything working OK now? B)

 

Not familiar at all really. I am starting a course soon though seeing as I am using it quite a lot now. :) All sorted though yes, thanks.

  • 5 months later...
Posted

Hi, everyone.

 

I need to remove the column left in index.php too but only in the product_listing.

 

I´d tried to change MrPhil´s solution but it didn´t work.

 

Could anyone help me with my problem?

 

I don´t know what coult I do more, I can´t find the solution in the forum and I´m not a good programer...

 

Thank you very much!

 

Silvia.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...