Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Categories boc heading and contents


scalplejockey

Recommended Posts

Posted

Hi all

 

After weeks of getting my isp beeten into shape and the abandoning them for a Much!!! supierior firm.

I am about to upload my site (hopefully in the next few days!).

 

I have a real newbie prolem

 

I have replaced the background image in the header of my 'Catagories box', by creating and alternate class in boxes.php for it, adding class to the css and moding the Categories box to use the new class, great! works a treat, but now the text in the header is left aligned and to work with my image it needs to be centered, but I have searched this forum more than once, and the knowledge base, even google'd a couple of times, and I cannot find the answer.

I have tried altering (cafully, with backup's) a lot of different files, in a lot of different places. but for the life of me I can not seem to get this to happen.

 

I reallise this is probably very simple, but it has me and I hope one of you can help

 

ps i know I coudl create it as a graphic with the text but thisimage will be used for most of my box headers and this means only updating one file when the style of the site changes!

Posted
Icould realy do with the help!!!!

 

Couldn't you style the text using the "TD.infoBoxHeading" css?

TD.infoBoxHeading {
text-align: center;
}

 

The class for this is in your boxes.php file.

 

Sheri

Posted

Have you created your new class as TD.newClass or just .newClass?

 

You could have used the TD.infoBoxHeading class, it would have saved you a lot of coding.

Posted

Hi spax

 

Yes it is created as td.infoBoxHeadingAlt

as you said, this saves a hell of a lot of coding and means that I can flip box code with just a few key strokes in the correct file.

 

Here is the file section from stylssheet.css

 

TD.infoBoxHeadingAlt {

font-family: "Times New Roman", Times, serif;

font-variant: small-caps;

color: #FFFFFF;

height: 32px;

text-align: centre;

font-size: 16px;

font-weight: bold;

background: url(images/infobox/BoxHeaderAlt.gif) no-repeat;

}

 

Hrere is the entry in ifl includes\classes\boxes.php

 

class infoBoxHeadingAlt extends tableBox {

function infoBoxHeadingAlt($contents) {

$this->table_cellpadding = '0';

 

$info_box_contents = array();

$info_box_contents[] = array(array('params' => 'width="100%"

class="infoBoxHeadingAlt"',

'text' => $contents[0]['text']));

 

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

}

}

 

 

 

 

here is the entry in categories.php starting at approx line 61

 

<!-- categories //-->

<tr>

<td>

<?php

$info_box_contents = array();

$info_box_contents[] = array('text' => BOX_HEADING_CATEGORIES);

 

new infoBoxHeadingAlt($info_box_contents, true, false);

 

Hope the answer is in there!

Posted
Hi spax

Here is the file section from stylssheet.css

 

TD.infoBoxHeadingAlt {

font-family: "Times New Roman", Times, serif;

font-variant: small-caps;

color: #FFFFFF;

height: 32px;

text-align: centre;

font-size: 16px;

font-weight: bold;

background: url(images/infobox/BoxHeaderAlt.gif) no-repeat;

}

Hope the answer is in there!

 

The first thing that jumped out at me is that centre is spelt the correct way as I have always used it....but it is not spelt that way in css. You need to use the American spelling "center".

 

Hope that's all it is!

 

Sheri

Archived

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

×
×
  • Create New...