Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Heading Text Replacement


dtucker40

Recommended Posts

Posted

Hello to all I would like to remove the category text from the top of my pages and replace them with images but don’t know where to add the script to the stylesheet.css I have changed the other script Please help my site is at www.nickelwise.net

 

The script to be replaced is in red

 

The script already replaced is in blue

 

Thank you in advance for your help Nickelwise

 

Heading Text Replacement

The simple method of having images in the box heading is to replace the heading text

value with an image.

This can be done by editing the main language file in the includes/languages/ directory,

for example includes/languages/english.php.

 

To replace the Categories box heading with an image, the heading title definition of

BOX_HEADING_CATEGORIES will need to be changed from:

define('BOX_HEADING_CATEGORIES', 'Categories');

To:

define('BOX_HEADING_CATEGORIES', '<img src="images/a_graphic_image.gif">');

Use Of Cascading Style Sheets

The advanced method of having images in the box heading is to create CSS definitions

for each box where an image is to be shown.

The following example concentrates on the Categories box and needs the following three

files to be modified:

includes/classes/boxes.php includes/boxes/categories.php stylesheet.css

The following code should be added to includes/classes/boxes.php at the very bottom of

the page right before the ending ?> tag:

class infoBoxHeadingCategories extends tableBox {

function infoBoxHeadingCategories($contents) {

$this->table_cellpadding = '0';

$info_box_contents = array();

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

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

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

}

}

The code above creates a new class called infoBoxHeadingCategories which will be used

in the Categories box.

The following code in includes/boxes/categories.php:

new infoBoxHeading($info_box_contents, true, false);

should be replaced with:

new infoBoxHeadingCategories($info_box_contents, true, false);

As the new infoBoxHeadingCategories class uses a new stylesheet definition just for the

Categories box, the following needs to be added to the stylesheet.css file:

TD.infoBoxHeadingCategories {

background: #33c3d3;

background-image: url('images/some_graphic.gif');

background-repeat: no-repeat;

}

This new class in the stylesheet can have the font, size, spacing, etc. set according to css

styles.

 

Archived

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

×
×
  • Create New...