Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Change left column width


jey

Recommended Posts

In the default setup of osCommerce v2.3(1) both columns have the same width. This width is set in "grids" in file catalog/includes/classes/osc_template.php. Just on top you see

   var $_grid_container_width = 24;
   var $_grid_content_width = 16;
   var $_grid_column_width = 4;

 

You can change this numbers to anything you want, just take care that (column_width x2) + content_width = 24 always

 

If you want to have a different width for left and right columns, (in case you use both) you would need to make separate var's for each column, separate set and get functions and then also use the proper (left or right) when the actual width is getting calculated,

 

file includes/template_top.php

  if (!$oscTemplate->hasBlocks('boxes_column_left')) {
   $oscTemplate->setGridContentWidth($oscTemplate->getGridContentWidth() + $oscTemplate->getGridColumnWidth());
 }

 if (!$oscTemplate->hasBlocks('boxes_column_right')) {
   $oscTemplate->setGridContentWidth($oscTemplate->getGridContentWidth() + $oscTemplate->getGridColumnWidth());
 }

 

file includes/template_bottom.php

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

and

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

Link to comment
Share on other sites

  • 2 months later...

In the default setup of osCommerce v2.3(1) both columns have the same width. This width is set in "grids" in file catalog/includes/classes/osc_template.php. Just on top you see

   var $_grid_container_width = 24;
   var $_grid_content_width = 16;
   var $_grid_column_width = 4;

 

You can change this numbers to anything you want, just take care that (column_width x2) + content_width = 24 always

 

If you want to have a different width for left and right columns, (in case you use both) you would need to make separate var's for each column, separate set and get functions and then also use the proper (left or right) when the actual width is getting calculated,

 

file includes/template_top.php

  if (!$oscTemplate->hasBlocks('boxes_column_left')) {
   $oscTemplate->setGridContentWidth($oscTemplate->getGridContentWidth() + $oscTemplate->getGridColumnWidth());
 }

 if (!$oscTemplate->hasBlocks('boxes_column_right')) {
   $oscTemplate->setGridContentWidth($oscTemplate->getGridContentWidth() + $oscTemplate->getGridColumnWidth());
 }

 

file includes/template_bottom.php

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

and

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

 

 

Hello i have done this with 2.3.1 default template and for some reason the right boxes are going under the left boxes so all the boxes are going on the left

 

please help me doing my head in thanks

Link to comment
Share on other sites

Hello i have done this with 2.3.1 default template and for some reason the right boxes are going under the left boxes so all the boxes are going on the left

 

CAn you say exactly what you have done?

 

Also, did you add anywhere to the columns a margin or border or something like that?

Link to comment
Share on other sites

CAn you say exactly what you have done?

 

Also, did you add anywhere to the columns a margin or border or something like that?

 

 

all i did was add the coding then i changed the width,

 

i have a boxes on the left and right i just need to make them a tiny bit bigger thats all

 

but when i do the right side boxes move over to the left or sometimes dissappear

 

http://67.23.248.28/~ash10/ :- temp site url ( you will see why the boxes need wider

 

(also dont use Internet Explorer Browser as site dont work very well on that

 

thanks

Link to comment
Share on other sites

all i did was add the coding then i changed the width,

 

Well, obviously you did somewhere a mistake.

 

Nobody can tell you what mistake if you don't say what you did.

 

Can you please say what "coding" you changed, in what way, and what width you changed and what values you added etc?

 

Best is you post code parts (not complete files) saying how it was before and how it is after your changes

Link to comment
Share on other sites

  • 1 month later...

First of all thnx for this!

 

It does indeed work, but th effect is not the one I was hoping for!

 

var $_title;

var $_blocks = array();

var $_grid_container_width = 24;

var $_grid_content_width = 16;

var $_grid_column_width =4;

 

Thats the standart, if I change any of the values to a bigger value, the boxes will move out of place, or dissappear, I supose it´s set somewhere in the php files what the Max. size can be.. Any tips? I need to enlarge it only a little, not a big change I want to do, but the slightest change dislocates the whole layout.

 

All I need is a little bigger content box to amplify the writing by a few sizes!

 

Thanks in advance!

Link to comment
Share on other sites

Have you read the posts further up. You must keep to a total of 24. 16 + 4 + 4 = 16.

Try using

 

var $_title;

var $_blocks = array();

var $_grid_container_width = 24;

var $_grid_content_width = 14;

var $_grid_column_width =5;

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

  • 2 months later...

I've been trying all day long now to get this darn thing to work. I've added in code but all I git was a huge error where the left hand column dominated the entire website. This is the code I used in the includes/classes/osc_template.php file for doing it, maybe one of you can show where I've gone wrong...

 

  
     class oscTemplate {

     var $_title;
     var $_blocks = array();
     var $_grid_container_width = 24;
     var $_grid_content_width = 14;
     var $_grid_left_column_width = 6;
     var $_grid_right_column_width = 4:

 

And these are the changes I've made to the lower section of my includes/template_top.php file

 

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

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

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

 

Can someone please show me where I've screwed it up so I can get this show on the road here...many thanks all your help is really appreciated...

 

Cheers,

DougB

Link to comment
Share on other sites

Is there no one out there willing to help me figure this out...wow. I've never had a post go so slow before here...everyone must be out there enjoying the weekend I guess. However if anyone wants to try and take a shot at helping out here I'd be more that grateful, honestly. Thanks in advance gang...

 

Cheers,

DougB

Link to comment
Share on other sites

  • 5 months later...

Not sure if you're still out there looking for an answer, DougB, but I'll reply just in case.. I haven't tried this yet, but from taking a quikc look, I understand that if you modify "template top" you also need to modify "template bottom". Cheers

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...