Web Design Tutorials osCommerce Template Tutorials
New osCommerce Templates osCommerce Specials osCommerce Forums Search Our Site Contact Us Resources Web Design Tutorials
Web Designers Library- Tutorials and Articles
Tutorial Search
  Advanced Search
 
Tutorial Menu
 
 Video Tutorials
  · Dreamweaver
  · osCommerce
  · Installations
 
 Photoshop
  · Tutorials
  Photoshop Basics
  Special Effects
  Text Effects
  3D Effects
  Textures & Patterns
  Web Layout
  Drawing Techniques
  Color Management
  Photo Editing
  ImageReady Animation
  Miscellaneous
  · Articles
 
 Web Design Basics
  · Design Principles
  · Website Usability
  · Color Theory
  · Templates & Tuning
 
 osCommerce
  · osCommerce Knowledgebase
  Catalog Area
  Installation and Upgrades
  Administration Tool
  General Information
  Developers Section
What's New
Latest Tutorials and Articles
Video Tutorials
osCommerce Tutorials
Template installation with cPanel and Ipswitch
Photoshop
Photoshop CS3: Output Sharpening
Change Color on an Object
Sunlight Effect
Autumn Effect
Eyes in Green Pea Pod
Web Design Basics
A To Z About RSS
Elements of Great Websites
The Next Generation Website Model
Why Use a Web Design Template?
Web Site Templates and Their Benefits
osCommerce
SSL - This page contains secure and non secure items
Post-Installation
Security - .htaccess
SSL - This page contains secure and non secure items
Tax Proposal
osCommerce : osCommerce Knowledgebase : Catalog Area Last Updated: Apr 15th, 2008 - 18:38:37


Add Images To Box Headings
Author: oscommerce.info
Authors Website: oscommerce.info
Oct 22, 2006, 11:29

Email this article
 Printer friendly page
Introduction

Images can be added to each box displayed in the left and right side columns, where the same image is used for all boxes or where different images are used for different boxes.

Solution
  • Heading Text Replacement
  • Use Of Cascading Style Sheets

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.




Top of Page

 
Level Ten Hosting