Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Category Box Background Change


Madman00

Recommended Posts

The Following controls the background color of all the infoboxes:

 

}

.infoBoxContents {

background: #ffffff;

font-family: Verdana, Arial, sans-serif;

font-size: 10px;

}

 

I just want to change the bacjground color of the category box.

 

so I added the following to stylesheet.css

}

 

.infoBox1 {

background: #ffffff;

font-family: Verdana, Arial, sans-serif;

font-size: 10px;

}

 

My categories.php have the following that

 

$info_box_contents = array();

$info_box_contents[] = array('align' => 'left',

'text' => $categories_string

);

new infoBox($info_box_contents);

?>

 

Where in categories do we make modifications to make it take effect. Did i do everythign right in stylesheet.css.

 

Any Help is appriciated.

Link to comment
Share on other sites

Hi,

 

I did say it would change _all_ info boxes. :D

 

Line 134 in /includes/boxes/categories.php

 

new infoBox($info_box_contents);

 

calls the class in /includes/classes/boxes.php , which of course is called by other PHP files. Just for testing, change line 86 back to .......

 

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

 

then modify line 134 in /includes/boxes/categories.php to ....

 

$tempvar = new infoBox($info_box_contents);

 

then add immediately after that line .........

 

$tempvar = str_replace("infoBoxContents", "infoBox1", $tempvar); //replace class 'infoBoxContents' with class 'infoBox1'
echo $tempvar;

 

It's untested, so no guarantees. :)

 

Peter

Link to comment
Share on other sites

  • 3 weeks later...

$tempvar is creating an error when it is modified in categories.php like you specified below. Any ideas. all i want to do is change the background color of the categories info box and leave the rest of the infoboxes background unaffected.

 

Thanks for the help.

 

Hi,

 

I did say it would change _all_ info boxes.  :D

 

Line 134 in /includes/boxes/categories.php

 

new infoBox($info_box_contents);

 

calls the class in /includes/classes/boxes.php , which of course is called by other PHP files.  Just for testing, change line 86 back to .......

 

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

 

then modify line 134 in  /includes/boxes/categories.php to ....

 

$tempvar = new infoBox($info_box_contents);

 

then add immediately after that line .........

 

$tempvar = str_replace("infoBoxContents", "infoBox1", $tempvar); //replace class 'infoBoxContents' with class 'infoBox1'
echo $tempvar;

 

It's untested, so no guarantees.  :)

 

Peter

Link to comment
Share on other sites

$tempvar is creating an error when it is modified in categories.php like you specified below. Any ideas. all i want to do is change the background color of the categories info box and leave the rest of the infoboxes background unaffected.

 

Thanks for the help.

 

For simplicity and avoiding unneccassary hacking I would install THIS contribution.

After that you can edit your heart out on each infobox seperately :D

Link to comment
Share on other sites

For simplicity and avoiding unneccassary hacking I would install THIS contribution.

After that you can edit your heart out on each infobox seperately  :D

 

 

I simply use this, no need to alter the classes .

 

$info_box_contents[] = array('align' => 'center',

'params' => 'valign="top" style="background-image: url(images/az_back_main.jpg); background-repeat: repeat-x;"',

'text' => $news_heading);

 

new contentBox($info_box_contents);

Treasurer MFC

Link to comment
Share on other sites

I simply use this, no need to alter the classes .

 

  $info_box_contents[] = array('align' => 'center',

                              'params' => 'valign="top" style="background-image: url(images/az_back_main.jpg); background-repeat: repeat-x;"',

                              'text'  => $news_heading);

 

  new contentBox($info_box_contents);

 

Interesting but how would that differentiate between the individual boxes ?

And this doesn't seem as flexibel as having the differences inside the CSS. There you can play around more easily when changing the individual boxes (let's say I want a different background for the category box, the news box, the new items box etc.) ?

Link to comment
Share on other sites

Interesting but how would that differentiate between the individual boxes ?

And this doesn't seem as flexibel as having the differences inside the CSS. There you can play around more easily when changing the individual boxes (let's say I want a different background for the category box, the news box, the new items box etc.) ?

 

 

I do this in the boxes code (categories.php, search.php, etc.) itself so every box can have a different style.

Treasurer MFC

Link to comment
Share on other sites

I do this in the boxes code (categories.php, search.php, etc.) itself so every box can have a different style.

 

Hello Amanda,

 

Thanks for the clarification, I now understand what you mean ! It is a matter of taste than I think, it is still easier to maintain one .css file as the multiple boxes files.

 

So little time and so much to learn, I like osC :lol:

Link to comment
Share on other sites

The below code doesn't seem to be working for me. it makes the category menu disappear. All i want to do is change the background of the category box only.

Any suggestions. Also if i could just enter a color # instead number instead of inputing an image as a background, that would be even better. Any suggestions. Thanks.

 

I simply use this, no need to alter the classes .

 

  $info_box_contents[] = array('align' => 'center',

                              'params' => 'valign="top" style="background-image: url(images/az_back_main.jpg); background-repeat: repeat-x;"',

                              'text'  => $news_heading);

 

  new contentBox($info_box_contents);

Link to comment
Share on other sites

Hi,

 

Email me the file /includes/boxes/categories.php if you want.

 

Got the file, thanks, first thing I noticed was that you appear to be running MS-1 ...

 

  $Id: categories.php,v 1.23 2002/11/12 14:09:30 dgw_ Exp $

 

is that correct, because I'd say most of the replies here would have assumed you were using the latest, MS-2.

 

Anyway, if you can't upgrade for some reason, I'll see what can be done.

 

Peter

Link to comment
Share on other sites

The below code doesn't seem to be working for me. it makes the category menu disappear. All i want to do is change the background of the category box only.

Any suggestions. Also if i could just enter a color # instead number instead of inputing an image as a background, that would be even better. Any suggestions. Thanks.

 

 

don't simply copy this code, it was an example of how to pass the params variables to the class.

Treasurer MFC

Link to comment
Share on other sites

Hi Amanda,

 

don't simply copy this code, it was an example of how to pass the params variables to the class.

 

I had the same thought/concept, to try and pass the parameter, and we have tried this, doesn't work.

 

I _think_ because the class/function 'infoBox' has this line:

 

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

 

that even if the class element/key of the array is parsed to the class/function, it is not getting overwritten ??

 

Peter

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...