stevennickelby Posted December 19, 2005 Posted December 19, 2005 I want the right hand boxes to have different fonts and colours then the right hand side.... I looked through, boxes.php and Stylesheet.css and the box file, But no matter what I try I can't work it out, would you help a poor sod? :x
buzuc Posted December 19, 2005 Posted December 19, 2005 a) In catalog/includes/classes/boxes.php before code (around line 100): class infoBoxHeading extends tableBox { add this : class infoBox2 extends tableBox { function infoBox2($contents) { $info_box_contents = array(); $info_box_contents[] = array('text' => $this->infoBoxContents2($contents)); $this->table_cellpadding = '1'; $this->table_parameters = 'class="infoBox2"'; $this->tableBox($info_box_contents, true); } function infoBoxContents2($contents) { $this->table_cellpadding = '3'; $this->table_parameters = 'class="infoBoxContents_particularbox"'; $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); } } Note the "2" added to modify the classes and functions names (required) and the "$this->table_parameters" for the functions b)go in includes/boxes/theboxyouwanttomodify.php : find the code : new infoBox($info_box_contents, infoBoxContents); replace it by : new infoBox2($info_box_contents, infoBoxContents_particularbox); c)and last, in stylesheet.css : at the end add : .infoBox2 { background: #?????; } .infoBoxContents_particularbox { background: #??????; font-family: Verdana, Arial, sans-serif; font-size: 10px; } replace the '?' by your colors values... it's done. simply call your left side boxes with new infoBox($info_box_contents, infoBoxContents); and your right side boxes with new infoBox2($info_box_contents, infoBoxContents_particularbox); as explained above ! MS2 2.2 fr + Manufacturer copy (5 manufacturers - modified to make it works) + More pics 6 + FCK Editor + zones shipping (modified without weight) + My contribution : Shopping Cart Management for Unique Products I apologize in advance for my poor English I'm French !
stevennickelby Posted December 19, 2005 Author Posted December 19, 2005 a) In catalog/includes/classes/boxes.php before code (around line 100): class infoBoxHeading extends tableBox { add this : class infoBox2 extends tableBox { function infoBox2($contents) { $info_box_contents = array(); $info_box_contents[] = array('text' => $this->infoBoxContents2($contents)); $this->table_cellpadding = '1'; $this->table_parameters = 'class="infoBox2"'; $this->tableBox($info_box_contents, true); } function infoBoxContents2($contents) { $this->table_cellpadding = '3'; $this->table_parameters = 'class="infoBoxContents_particularbox"'; $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); } } Note the "2" added to modify the classes and functions names (required) and the "$this->table_parameters" for the functions b)go in includes/boxes/theboxyouwanttomodify.php : find the code : new infoBox($info_box_contents, infoBoxContents); replace it by : new infoBox2($info_box_contents, infoBoxContents_particularbox); c)and last, in stylesheet.css : at the end add : .infoBox2 { background: #?????; } .infoBoxContents_particularbox { background: #??????; font-family: Verdana, Arial, sans-serif; font-size: 10px; } replace the '?' by your colors values... it's done. simply call your left side boxes with new infoBox($info_box_contents, infoBoxContents); and your right side boxes with new infoBox2($info_box_contents, infoBoxContents_particularbox); as explained above ! Buzuc, Thanks very much, it's works...there is still one problem, I can't control the text colour in the boxes (it allows me control of the text style; for instance Italics but not the colour - i had planned to have a "hover" on the text) the text colour is controlled by "A" in the "stylesheet.css"
buzuc Posted December 20, 2005 Posted December 20, 2005 ok, there is two solutions : 1/ put your text in catlog/includes/language/english.php and for example //box text for packaging define('BOX_HEADING_PACKAGING', '<hr>Preview of our<a class="yourstyle" href="' . tep_href_link(FILENAME_PACKAGING) . '"> Packaging</a>...'); define('BOX_PACKAGING', 'Packaging'); and add in the sytlesheet A.yourstyle { font-family: Verdana, Arial, sans-serif; font-size: 12px; color: #8ADBFF; text-decoration: none; font-weight: bold; } A.yourstyle:hover { font-family: Verdana, Arial, sans-serif; font-size: 12px; color: #666666; text-decoration: none; } of course you can replace my styles parameters with yours This is one solution, here is the other : 2/in catalog/includes/classes/boxes.php replace function infoBoxContents2($contents) { $this->table_cellpadding = '3'; $this->table_parameters = 'class="infoBoxContents_particularbox"'; $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'] : ''))); } the line 'params' => 'class="boxText"', with 'params' => 'class="yourstyle"', and add in stylesheet A.yourstyle { font-family: Verdana, Arial, sans-serif; font-size: 12px; color: #8ADBFF; text-decoration: none; font-weight: bold; } A.yourstyle:hover { font-family: Verdana, Arial, sans-serif; font-size: 12px; color: #666666; text-decoration: none; } and you're done ! MS2 2.2 fr + Manufacturer copy (5 manufacturers - modified to make it works) + More pics 6 + FCK Editor + zones shipping (modified without weight) + My contribution : Shopping Cart Management for Unique Products I apologize in advance for my poor English I'm French !
Recommended Posts
Archived
This topic is now archived and is closed to further replies.