matrix1000 Posted November 27, 2002 Posted November 27, 2002 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
Ajeh Posted November 27, 2002 Posted November 27, 2002 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.
matrix1000 Posted November 27, 2002 Author Posted November 27, 2002 Could you explain or give an example...If you have time...I'm barely PHP literate :D
Ajeh Posted November 27, 2002 Posted November 27, 2002 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.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.