Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

need some help with columns


bozamic

Recommended Posts

I am trying to remove the left and right columns from my intro page but I want them to be there when a guest goes to a category or product page.

 

I know how to remove the columns from the mainpage. But how do I get them to show on the other pages?

 

Thanks for any help you can give me.

Link to comment
Share on other sites

Surround all of the code you want to exclude in each column file with something like

	if (basename($PHP_SELF) == FILENAME_CONDITIONS) {

The above will only show the code when the conditions page is showing. Don't forget the closing bracket.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

I'm fairly new at this and am not following you.

 

I put this code on the column.php file? What is the 'conditions' page?

 

I want the entire column to be on every page except for the frontpage which I want no column at all.

 

Please advise.

 

Thanks

Link to comment
Share on other sites

Oh, I thought you were looking for a way to control for a number of files. The Conditions file is just a common file to all OSC shops (you have one in yours) and I was just using it as an example. If you want to remove the left column from home page, just remove the code for the left column in catalog/index.php - it looks like this:

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

Now, your index page handles showing three different parts - your home page, categories and products. Removing the above will remove for all three. If you want to remove for just the home page surround the above like so

if ($category_depth == 'nested' ||  ($category_depth == 'products' || isset($HTTP_GET_VARS['manufacturers_id']))) {
above code goes here
}

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

I appreciate your help. And this is definately what I am trying to acheive.

 

My problem now is that I am using a template so there are some differences.

 

Here is the code that controls my left column, center, and right column:

 

  <tr>
   <td class="columnLT" id="columnLeftLT"><?php require(DIR_WS_INCLUDES . 'column_left.php'); ?></td>
   <td id="contentLT"><?php
 if (isset($content_template)) {
   require(DIR_WS_CONTENT . $content_template);
 } else {
   require(DIR_WS_CONTENT . $content . '.tpl.php');
 }
?></td>
  <td class="columnLT" id="columnRightLT"><?php require(DIR_WS_INCLUDES . 'column_right.php'); ?></td>
 </tr>

 

When I added your code like this:

 

  <tr>
if ($category_depth == 'nested' ||  ($category_depth == 'products' || isset($HTTP_GET_VARS['manufacturers_id']))) {    <td class="columnLT" id="columnLeftLT"><?php require(DIR_WS_INCLUDES . 'column_left.php'); ?></td>  }
   <td id="contentLT"><?php
 if (isset($content_template)) {
   require(DIR_WS_CONTENT . $content_template);
 } else {
   require(DIR_WS_CONTENT . $content . '.tpl.php');
 }
?></td>
  <td class="columnLT" id="columnRightLT"><?php require(DIR_WS_INCLUDES . 'column_right.php'); ?></td>
 </tr>

 

it prints the new code at the top of the mainpage. If I add a <?php to the beginning of that code, I get an unexpected $ error.

 

I don't know where I am going wrong. Any clues?

Link to comment
Share on other sites

When php code is inserted into html code, it has to be enclosed in <?php & ?>. See if this is any better.

 

<?php if ($category_depth == 'nested' ||  ($category_depth == 'products' || isset($HTTP_GET_VARS['manufacturers_id']))) {    ?>
<tr>
<td class="columnLT" id="columnLeftLT"><?php require(DIR_WS_INCLUDES . 'column_left.php'); ?></td>  }
  <td id="contentLT"><?php
if (isset($content_template)) {
  require(DIR_WS_CONTENT . $content_template);
} else {
  require(DIR_WS_CONTENT . $content . '.tpl.php');
}
?></td>
 <td class="columnLT" id="columnRightLT"><?php require(DIR_WS_INCLUDES . 'column_right.php'); ?></td>
</tr>
<?php } ?>

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...