Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Simple Stylesheet Question...hopefully


matrix1000

Recommended Posts

Posted

I was wondering if you could tell me if there was a way to make the background color in the Catagories table/box black yet leave all the other tables the same. I have already used .infoBoxContents in stylesheet.css to change the background to an image but I need the CATAGORIES box to have a black background with no background image.

 

.infoBoxContents {

background: #000000 url(images/carbon.gif);

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

font-size: 14px;

 

This is probably very simple but I'm stumped because when I add a new class with background: #000000 it is over ridden by the infoBoxContents class (I think) any help would be greatly appreciated.

 

Thanks :D

Posted

You could set a variable in the /boxes/categories.php box then retrieve the variable in the /classes/boxes.php and alter which styles are being used based on that variable.

Posted

In /boxes/categories.php you would set just above the first $info_box_contents = array();

 

$my_categories_box='1';

 

Now, edit the /classes/boxes.php

 

Each function in there defines an aspect of the box.

 

Where you need to make the change, add just beneath the function blah line:

 

global $my_categories_box;

 

Now within that function where you see the class definition you would write an if statement based on that variable.

 

Example:

 

  class infoBox extends tableBox {

   global $my_categories_box;

   function infoBox($contents) {

     $info_box_contents = array();

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

     $this->table_cellpadding = '1';

     if ($my_categories_box=='1') {

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

     } else {

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

     }

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

   }

 

This would assume you made a new style called infoBoxCategories.

 

When $my_categories_box is set to 1 it uses that style otherwise it uses the regular style.

Archived

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

×
×
  • Create New...