Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Infobox(s) size(s)


cor_dog2

Recommended Posts

Hi I was wondering if anyone knows how to change the height and width of the infoboxes? (categories box, what's new box, etc.)

 

for the width:

includes/application_top.php

// customization for the design layout
 define('BOX_WIDTH', 135); // how wide the boxes should be in pixels (default: 125)

both columns have the same width, if you need different width, you need to make two new defines and call those in your files

'BOX_WIDTH_LEFT'

'BOX_WIDTH_RIGHT'

 

 

For the height, you can add spacer lines to make the height bigger.

 

:-)

Monika

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

for the width:

includes/application_top.php

// customization for the design layout
?define('BOX_WIDTH', 135); // how wide the boxes should be in pixels (default: 125)

both columns have the same width, if you need different width, you need to make two new defines and call those in your files

'BOX_WIDTH_LEFT'

'BOX_WIDTH_RIGHT'

For the height, you can add spacer lines to make the height bigger.

 

:-)

Monika

 

Could you clarify the process in widening the Left Column (BOX_WIDTH_LEFT). I am afraid to try to enter a new define on my own.

I already found how to widen both columns in the Documentation area of oSC.

Thanks!

Link to comment
Share on other sites

Could you clarify the process in widening the Left Column (BOX_WIDTH_LEFT). I am afraid to try to enter a new define on my own.

I already found how to widen both columns in the Documentation area of oSC.

Thanks!

 

 

if you want to change the left box only, add this to application top:

// customization for the design layout, left column only
define('BOX_WIDTH_LEFT', 125); // how wide the boxes should be in pixels (default: 125)

 

then you must go through all your files in catalog, search for left_navigation. Right above that there is the variable BOX_WIDTH, used TWICE. Change both to BOX_WIDTH_LEFT, like I said in all files. A bit tedious but it will do the job. Too bad is wasn't separated into two variables from the start.

 

:-)

Monika

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

  • 5 months later...
Monika,

 

Great work. I am a little confused on how to do the hieght of the infobox. Can you please clarify?

 

Thanks

 

Charles

 

 

Hi Charles,

 

this is what includes/classes/boxes.php currently says for the infobox class:

 

class infoBox extends tableBox {

function infoBox($contents) {

$info_box_contents = array();

$info_box_contents[] = array('text' => $this->infoBoxContents($contents));

$this->table_cellpadding = '1';

$this->table_parameters = 'class="infoBox"';

$this->tableBox($info_box_contents, true);

}

 

function infoBoxContents($contents) {

$this->table_cellpadding = '3';

$this->table_parameters = 'class="infoBoxContents"';

$info_box_contents = array();

$info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));

for ($i=0, $n=sizeof($contents); $i<$n; $i++) {

$info_box_contents[] = array(array('align' => (isset($contents[$i]['align']) ? $contents[$i]['align'] : ''),

'form' => (isset($contents[$i]['form']) ? $contents[$i]['form'] : ''),

'params' => 'class="boxText"',

'text' => (isset($contents[$i]['text']) ? $contents[$i]['text'] : '')));

}

$info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));

return $this->tableBox($info_box_contents);

}

}

 

I've bolded for you where before and after the main content a spacer line, here 1px (and of course the padding added) is added. You can add as many px as you need. The infobox header is similar:

 

class infoBoxHeading extends tableBox {

function infoBoxHeading($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {

$this->table_cellpadding = '0';

 

if ($left_corner == true) {

$left_corner = tep_image(DIR_WS_IMAGES . 'infobox/corner_left.gif');

} else {

$left_corner = tep_image(DIR_WS_IMAGES . 'infobox/corner_right_left.gif');

}

if ($right_arrow == true) {

$right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_IMAGES . 'infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';

} else {

$right_arrow = '';

}

if ($right_corner == true) {

$right_corner = $right_arrow . tep_image(DIR_WS_IMAGES . 'infobox/corner_right.gif');

} else {

$right_corner = $right_arrow . tep_draw_separator('pixel_trans.gif', '11', '14');

}

 

$info_box_contents = array();

$info_box_contents[] = array(array('params' => 'height="14" class="infoBoxHeading"',

'text' => $left_corner),

array('params' => 'width="100%" height="14" class="infoBoxHeading"',

'text' => $contents[0]['text']),

array('params' => 'height="14" class="infoBoxHeading" nowrap',

'text' => $right_corner));

 

$this->tableBox($info_box_contents, true);

}

}

 

here oyu need to replace teh current infobox images to a new image with the height you want to use (I used 18px on my website) and change all occurrencies of the "14" to "18", instant success :-)

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

Excellent.

 

I was successfull at changing the hieght of the infobox but what I found is that it changed all the left boxes heights. Is there a way to just change a desired box such as category only and not effecting What's new, etc.?

 

Thanks for your help.

 

Charles

Link to comment
Share on other sites

Excellent.

 

I was successfull at changing the hieght of the infobox but what I found is that it changed all the left boxes heights. Is there a way to just change a desired box such as category only and not effecting What's new, etc.?

 

Thanks for your help.

 

Charles

 

absolutely! As the infobox class is called for each infobox, it will naturally affect all boxes.

 

To only change one box, copy the part that I had put in my last post and rename the class AND the function ... it's 4 spots

 

class infoBox extends tableBox {

function infoBox($contents) {

$info_box_contents = array();

$info_box_contents[] = array('text' => $this->infoBoxContents($contents));

$this->table_cellpadding = '1';

$this->table_parameters = 'class="infoBox"';

$this->tableBox($info_box_contents, true);

}

 

function infoBoxContents($contents) {

$this->table_cellpadding = '3';

$this->table_parameters = 'class="infoBoxContents"';

$info_box_contents = array();

$info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));

for ($i=0, $n=sizeof($contents); $i<$n; $i++) {

$info_box_contents[] = array(array('align' => (isset($contents[$i]['align']) ? $contents[$i]['align'] : ''),

'form' => (isset($contents[$i]['form']) ? $contents[$i]['form'] : ''),

'params' => 'class="boxText"',

'text' => (isset($contents[$i]['text']) ? $contents[$i]['text'] : '')));

}

$info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));

return $this->tableBox($info_box_contents);

}

}

 

exchange the bolded terms by new ones, keeping the current pairing.

Edit the height to your heart's content ;-)

 

Then open the box code in the boxes folder for what's new or whichever box needs changing, and in the last section, where the box is created, call the new class name instead of infobox.

say you renamed the class to infoBoxTall it will become

 

new infoBoxTall($info_box_contents);

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

I did the below but got error on catalog/includes/classes/boxes.php on line 142 not sure what I am doing wrong:

 

Are you saying that if I want to change only Categories box go into boxes/categories.php and remame: new infoBoxTall($info_box_contents); to new Categories ($info_box_contents);

 

And then copy and past your last post making a seperate section and rename like this:

 

class Categories extends tableBox {

function Categories($contents) {

$info_box_contents = array();

$info_box_contents[] = array('text' => $this->Categories($contents));

$this->table_cellpadding = '1';

$this->table_parameters = 'class="infoBox"';

$this->tableBox($info_box_contents, true);

}

 

function Categories ($contents) {

$this->table_cellpadding = '3';

$this->table_parameters = 'class="infoBoxContents"';

$info_box_contents = array();

$info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));

for ($i=0, $n=sizeof($contents); $i<$n; $i++) {

$info_box_contents[] = array(array('align' => (isset($contents[$i]['align']) ? $contents[$i]['align'] : ''),

'form' => (isset($contents[$i]['form']) ? $contents[$i]['form'] : ''),

'params' => 'class="boxText"',

'text' => (isset($contents[$i]['text']) ? $contents[$i]['text'] : '')));

}

$info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));

return $this->tableBox($info_box_contents);

}

}

 

 

Thanks for your help

Link to comment
Share on other sites

I did the below but got error on catalog/includes/classes/boxes.php on line 142 not sure what I am doing wrong:

 

Are you saying that if I want to change only Categories box go into boxes/categories.php and remame: new infoBoxTall($info_box_contents); to new Categories ($info_box_contents);

 

And then copy and past your last post making a seperate section and rename like this:

 

class Categories extends tableBox {

function Categories($contents) {

$info_box_contents = array();

$info_box_contents[] = array('text' => $this->Categories($contents));

$this->table_cellpadding = '1';

$this->table_parameters = 'class="infoBox"';

$this->tableBox($info_box_contents, true);

}

 

function Categories ($contents) {

$this->table_cellpadding = '3';

$this->table_parameters = 'class="infoBoxContents"';

$info_box_contents = array();

$info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));

for ($i=0, $n=sizeof($contents); $i<$n; $i++) {

$info_box_contents[] = array(array('align' => (isset($contents[$i]['align']) ? $contents[$i]['align'] : ''),

'form' => (isset($contents[$i]['form']) ? $contents[$i]['form'] : ''),

'params' => 'class="boxText"',

'text' => (isset($contents[$i]['text']) ? $contents[$i]['text'] : '')));

}

$info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));

return $this->tableBox($info_box_contents);

}

}

Thanks for your help

 

Charles,

 

you changed all bolded items to the same, while it's 2 different words. Like I said you need 2 new expressions, keeping the pairs correct, so the 2 first bolded are the same and the 2 last also.

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...