Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

reorganise only index.php


zeberrun

Recommended Posts

oscommerce 2,3,1.

 

i have been searching days and still can not succeed. i looked everywhere but no solution.

 

product pages of many sites are without right column. but index have.

 

i need to code template_top, bottom and osc_template.php

 

i started from template bottom and this code works perfect.

 

<?php

}

if ($oscTemplate->hasBlocks('boxes_column_right') && basename($PHP_SELF) == FILENAME_DEFAULT) {

?>

 

this shows right column only in index.php. but the other pages. And the place of right column is still empty or grid 12. (in 960 grid scale (24,12,6)) if no right column selected, grid is 18 in all the pages. when right column is active than grid is default 12. i guess this comes from template top. the below code defines the grid 12 or 18. but it is too comlicated for me.

 

please someone help me to modify this code, It must be default in index.php grid 12, but if other pages are called,it must turn grid 18.

 

<div id="bodyContent" class="grid_<?php echo $oscTemplate->getGridContentWidth(); ?> <?php echo ($oscTemplate->hasBlocks('boxes_column_left') ? 'push_' . $oscTemplate->getGridColumnWidth() : ''); ?>">

 

pls help

Link to comment
Share on other sites

thanks for advice but this contrib does not make any modification in template top and bottom. i think problem still exist in this contrib. the solution must be much more easy with code modification. all we need is to write a code. make grid 18 all the pages but 12 in index.php but how :)

Link to comment
Share on other sites

Hi Zeberrun,

 

I'm not quite sure what you mean, but I think you wan to remove a column from just the index.php (home) page. If so, you may have to modify it but you could try try something like this this in your template_bottom.php file:

<?php

if ( (strpos($_SERVER['PHP_SELF'], 'index.php')) && (!isset($_GET['manufacturers_id']) && (!$current_category_id))) {

// dont display anything

} else { ?>

 

<div id="columnLeft" class="one_fourth pull_9"><?php echo $oscTemplate->getBlocks('boxes_column_left'); ?></div>

<?php

}

?>

 

You can see how this works on the home page of my site at www.linjong.com where the left column gas been removed only on the home page. If you go to other pages on the site you'll see that the left column is still showing.

 

Hope this helps.

 

Isatree

Link to comment
Share on other sites

hello lingong,

 

this does not work for me. i have blocks determined in template top

if only cloumn left boxes active, it makes class"grid_18 if also right column boxes active it makes class"grid_12

this situation spreads the center block to empty area.

 

 

$oscTemplate->buildBlocks();

 

if (!$oscTemplate->hasBlocks('boxes_column_left')) {

$oscTemplate->setGridContentWidth($oscTemplate->getGridContentWidth() + $oscTemplate->getGridColumnWidth());

}

 

if (!$oscTemplate->hasBlocks('boxes_column_right')) {

$oscTemplate->setGridContentWidth($oscTemplate->getGridContentWidth() + $oscTemplate->getGridColumnWidth());

}

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...