Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Background Image for top banner table?


urgrund

Recommended Posts

Posted

hey people - I cannot seem to get an image to be displayed for the background of the top banner, where the store logo and the Account/Cart/Checkout images are.

 

I've tried numerous things.

I create a css class

TABLE.header {
BACKGROUND-IMAGE: url(../images/subcategory.gif); HEIGHT: 100px
}

 

no good - but it works when operating locally on the site in Dreamweaver.

 

I tried hardcoding it in header.php (line 55)

no good either - no image was displayed.

<table border="0" width="100%" cellspacing="0" cellpadding="0" background="<?php tep_image(DIR_WS_IMAGES . 'header_account.gif', HEADER_TITLE_MY_ACCOUNT) . ; ?>">

 

Is there particular way to do this?

I'm not that familier with highly code driven pages so I understand I may be trying to edit the code in the wrong places?

Has anyone else needed to do this?

 

Thanks!

Matt

Posted

The PHP part of the code should be:

 

<?php echo DIR_WS_IMAGES . 'header_account.gif'; ?>

 

But I found that you need to remove the class from the following table row tag in order for it to work.

 

i.e. the next line (in vanilla osC):

 

 <tr class="header">

 

Needs to be:

 

  <tr>

 

You can't use tep_image because it outputs code like:

 

<img src="image name here" and blah blah blah >

 

(code for HTML img tag)

 

The correct CSS code that worked for me was:

 

TABLE.header {        BACKGROUND-IMAGE: url(images/header_account.gif); HEIGHT: 100px}

 

But I had to add the class to the table tag:

 

<table border="0" cellpadding="0" cellspacing="0" width="100%" class="header">

 

And still remove the style from the table row tag as stated previously.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Archived

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

×
×
  • Create New...