PDA

View Full Version : infoBox headers



glynn
03-17-2004, 02:43 PM
I need to change some but not all of the infobox (shopping cart) header background colours. Since the template system affects all the boxes how do I change 1 or 2.

Also I need to add an image to the privacy page ( not a background image) how do I go about this.

jonthewebb
03-18-2004, 04:25 PM
easiest way would be to create a new box template. Copy the old one exactly, named (eg) box2.tpl.php in the same directory (catalog/templates/)

In the new one, on lines 6-8:

<tr>
<td height="14" class="infoBoxHeading"><img src="images/infobox/<?php switch ($corner_left) { case 'square': echo 'corner_right_left.gif'; break; case 'rounded': echo 'corner_left.gif'; break;} ?>" border="0" alt="" width="11" height="14"></td>
<td width="100%" height="14" class="infoBoxHeading"><?php echo $boxHeading; ?></td>
<td height="14" class="infoBoxHeading" nowrap><?php echo $boxLink; ?><img src="images/<?php switch ($corner_right) { case 'square': echo 'pixel_trans.gif'; break; case 'rounded': echo 'infobox/corner_right.gif'; break;} ?>" border="0" alt="" width="11" height="14"></td>
</tr>

change the 'class="infoBoxHeading"' to 'class="infoBoxHeadingTwo"'

then in catalog/stylesheet.css

add the following item



TD.infoBoxHeadingTwo {
font-family: Verdana, Arial, sans-serif;
font-size: 10px;
font-weight: bold;
background: #{YOUR COLOUR IN HERE};
color: #ffffff;
}

just after where you find the current infoBoxHeading style.

Then, go to each of the boxes which need the special colour and change:




require(DIR_WS_TEMPLATES . TEMPLATENAME_BOX);


to



require(DIR_WS_TEMPLATES . 'box2.tpl.php');


strictly speaking you should define new entries in includes/filename.php and use that constant, but that would take more time and effort. This should work.

jw

glynn
03-19-2004, 11:54 AM
It worked a treat. I had almost worked it all out. I was just calling the new template wrongly.

Many thanks jw

Glynn