Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Using Header Images - Adding Links?


jousley

Recommended Posts

I think might be an easy question. But I have added header images to my infoboxes using the stylesheet. How can I make sure that these images have a link to the appropriate page.

 

For example the shopping cart info box has the following code (shopping_cart.php) :

<?php
 $info_box_contents = array();
 $info_box_contents[] = array('text' => BOX_HEADING_SHOPPING_CART);

 new shoppingcartboxheader($info_box_contents, false, true, tep_href_link(FILENAME_SHOPPING_CART));

etc etc etc.

 

You can see that I have used a custom style in the stylesheet named "shoppingcartboxheader".

 

Here is my css code for "shoppingcartboxheader".:

TD.shoppingcartboxheader {
background: #FFFFFF;
background-image: url('images/shoppingcartheaderpic.gif');
background-repeat:no-repeat;

So where do I add the link to ensure that when the picture is clicked - they go to the shopping cart page?

 

Thanks in advance.

 

Jonathan

Link to comment
Share on other sites

You can't link the background image, you need it to display as a normal image to do that. That is why there is a little arrow on the headings that are linked. If you have text on top of the background image, you could use that to link. Something like this in shopping_cart.php for instance:

 

<?php
 $info_box_contents = array();
 $info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . BOX_HEADING_SHOPPING_CART . '</a>');

 new shoppingcartboxheader($info_box_contents, false, true, tep_href_link(FILENAME_SHOPPING_CART));

Link to comment
Share on other sites

You can't link the background image, you need it to display as a normal image to do that. That is why there is a little arrow on the headings that are linked. If you have text on top of the background image, you could use that to link. Something like this in shopping_cart.php for instance:

 

<?php
 $info_box_contents = array();
 $info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . BOX_HEADING_SHOPPING_CART . '</a>');

 new shoppingcartboxheader($info_box_contents, false, true, tep_href_link(FILENAME_SHOPPING_CART));

 

I did as you said and it seemed to work perfectly. the link is fine. However, now I have a border around my image. How can I get rid of this border?

 

Thanks

 

Jonathan

Link to comment
Share on other sites

If you used the tep_image() function, you wouldn't have a border. However, you can add this to your stylesheet to remove it:

 

img {
border: none;
}

 

 

yes that worked perfectly. Thanks very much for your help

Jonathan

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...