Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

remove right column but index.php


zeberrun

Recommended Posts

Posted

i think ths is important, none of the web sites have right column in all the pages but oscommerce has.

 

oscommerce 2,3,1 i want to show right column only index.php. in 960 grid (24,12,6) default, center grid_12, columns grid_6. if there is no right or left column, center grid size become 18, calculating left column grid_6 and center grid_12. but if any of the column active than center grid become 12.

i guess three files control grid system. i am not sure just explain what i understood.

 

osc template.php part of page.

-----------------------------

class oscTemplate {

var $_title;

var $_blocks = array();

var $_grid_container_width = 24;

var $_grid_content_width = 12;

var $_grid_column_width =6;

 

function oscTemplate() {

$this->_title = TITLE;

}

function setGridContainerWidth($width) {

$this->_grid_container_width = $width;

}

 

function getGridContainerWidth() {

return $this->_grid_container_width;

}

 

function setGridContentWidth($width) {

$this->_grid_content_width = $width;

}

 

function getGridContentWidth() {

return $this->_grid_content_width;

}

 

function setGridColumnWidth($width) {

$this->_grid_column_width = $width;

}

 

function getGridColumnWidth() {

return $this->_grid_column_width;

}

-------------------------------

template_bottom.php

changing $oscTemplate->hasBlocks('boxes_column_right') to $oscTemplate->hasBlocks ('boxes_column_right')&&(strpos($_SERVER['PHP_SELF'], 'index.php')) i can see right column in index.php. but in all the other pages, right columns area is empty. that means center block grid_12

----------------------------------

<?php

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

?>

<div id="columnLeft" class="grid_<?php echo $oscTemplate->getGridColumnWidth(); ?> pull_<? php echo $oscTemplate->getGridContentWidth(); ?>">

<div><?php echo $oscTemplate->getBlocks('boxes_column_left'); ?></div>

</div>

 

<?php

}

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

?>

 

<div id="columnRight" class="grid_<?php echo $oscTemplate->getGridColumnWidth(); ?>">

<div><?php echo $oscTemplate->getBlocks('boxes_column_right'); ?></div>

</div>

 

<?php

}

?>

</div>

 

<div class="container_<?php echo $oscTemplate->getGridContainerWidth(); ?> ofh row_5">

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

-------------------------------------

template_top

if left and right column active, (line-1) bodyContent changes grid_12, but any of them is inactive changes grid_18.

-------------------------------------

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

}

 

<div class="container_<?php echo $oscTemplate->getGridContainerWidth(); ?> ofh row_4">line-1

<div id="bodyContent" class="grid_<?php echo $oscTemplate->getGridContentWidth(); ?>

<?php echo ($oscTemplate->hasBlocks('boxes_column_left') ? 'push_' . $oscTemplate- >getGridColumnWidth() : ''); ?>"

--------------------------------------

 

questions

1- i do not understand setGridContentWidth is defined in template_top and osc_template. how it becomes 12 or 18. the if else statements are not finished.

2- how can i say if index.php show standart else show like one column active.

Posted

go with a tag such as

 

if ((int)$HTTP_GET_VARS['cPath']=='')

{echo include(DIR_WS_INCLUDES . 'column_right.php';}

else

{}

Or

 

if ($category_depth == 'products' && $category_depth == 'nested' )

{}

else

{echo include(DIR_WS_INCLUDES . 'column_right.php';}

 

i prefer the second method.

maybe adaptation is needed with these script but sure its will work i have set it up into my website.

i have write it by my mind

 

thank you and if you have others question, feel free.

Posted

code are almost the same,, you have to adapt a little.

 

 

 

if ($category_depth == 'products' && $category_depth == 'nested' ){

 

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

 

 

}

}

Posted

here is the solution.

this is for oscommerce 2,3,1 only index.php has right column.

also category links has no right column.

 

oscommerce mine column size=content grid_12, column grid_6

 

oscommerce default column size=content grid_16, column grid_4

 

if you have oscommerce default size than

replace the below code in template_top.php

<div id="bodyContent" class="grid_18

with

<div id="bodyContent" class="grid_20

 

template_bottom.php

 

replace

 

<?php

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

?>

<div id="columnLeft" class="grid_<?php echo $oscTemplate->getGridColumnWidth(); ?> pull_<?php echo $oscTemplate->getGridContentWidth(); ?>">

<div><?php echo $oscTemplate->getBlocks('boxes_column_left'); ?></div>

</div>

<?php

}

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

?>

<div id="columnRight" class="grid_<?php echo $oscTemplate->getGridColumnWidth(); ?>">

<div><?php echo $oscTemplate->getBlocks('boxes_column_right'); ?></div>

</div>

<?php

}

?>

 

with

 

<?php

if ($oscTemplate->hasBlocks('boxes_column_left') && basename($PHP_SELF) == FILENAME_DEFAULT && $category_depth == 'top') {

?>

<div id="columnLeft" class="grid_<?php echo $oscTemplate->getGridColumnWidth(); ?> pull_<?php echo $oscTemplate->getGridContentWidth(); ?>">

<div><?php echo $oscTemplate->getBlocks('boxes_column_left'); ?></div>

</div>

<?php

} else {

?>

<div id="columnLeft" class="grid_<?php echo $oscTemplate->getGridColumnWidth(); ?> pull_18">

<div><?php echo $oscTemplate->getBlocks('boxes_column_left'); ?></div>

</div>

<?php

}

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

?>

<div id="columnRight" class="grid_<?php echo $oscTemplate->getGridColumnWidth(); ?>">

<div><?php echo $oscTemplate->getBlocks('boxes_column_right'); ?></div>

</div>

<?php

}

?>

 

template_top

 

replace

 

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

 

with

 

<?php

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

?>

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

<?php

} elseif (basename($PHP_SELF) == FILENAME_DEFAULT && ($category_depth == 'top')) {

?>

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

<?php

} else {

?>

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

<?php

}

?>

 

 

 

have a nice home page designs

Archived

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

×
×
  • Create New...