Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / How do I add second link to header image?

How do I add second link to header image?

Locked

Views: 1,266

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
27 Feb 2009, 12:20 AM
#1
salonroyalty avatar

salonroyalty

New Zenner

Join Date:
Feb 2009
Posts:
37
Plugin Contributions:
0

How do I add second link to header image?

I'm looking to make the "Get your Salon and day spa package today" image, link to my products page. Anyone know how I can do this?

https://www.SalonRoyalty.com

27 Feb 2009, 1:42 PM
#2
salonroyalty avatar

salonroyalty

New Zenner

Join Date:
Feb 2009
Posts:
37
Plugin Contributions:
0

Re: How do I add second link to header image?

Does noone know how to do this?

27 Feb 2009, 4:03 PM
#3
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: How do I add second link to header image?

It doesn't appear that the "Get Your..." image is a separate image, but part of the header bg. Is this correct? Assuming it is, you can add a new link to the header, and size it and position it absolutely so it covers the desired area.
Something like

<?php echo '<a id="spaDealLink" href="' . HTTP_SERVER . DIR_WS_CATALOG . 'index.php?main_page=index&cPath=1">'; ?><span class="textAway">Get your Salon & Day Spa package today!</span></a></li>

Add to your stylesheet:

#spaDealLink {
    display: block;
    position: absolute;
    top: 123px;
    left: 542px;
    width: 200px;
    height: 200px;
    }

.textAway {
    position: relative;
    left: -9999px;
    }

The .textAway allows the link to be meaningful to anyone, even using a screenreader, but puts the text way off the screen for ordinary users.

The index.php?main_page=index&cPath=1 may need to be adjusted a bit, I don't have time right now to check it.

Add the new link to /includes/templates/your_template/common/tpl_header.php below the logo code block.

28 Feb 2009, 2:51 AM
#4
salonroyalty avatar

salonroyalty

New Zenner

Join Date:
Feb 2009
Posts:
37
Plugin Contributions:
0

Re: How do I add second link to header image?

Thanks alot!! I really appreciate the help...a little tweaking and it is perfect. I had to remove the textaway because when you click the link a tan box pops up and runs the length of the screen. Unsure how to turn that off but I'm happy with the current results.

Bravo!!:clap:

28 Feb 2009, 5:27 PM
#5
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: How do I add second link to header image?

Glad to see you have it working.
I'm going to guess that you have a 1280px monitor.
The clickable area on my 1024px monitor is offset to the right of the text, because the position: absolute is calculating from the extreme left edge of the screen, which varies depending on the window width.
In your stylesheet, find```
/wrappers - page or section containers/
#mainWrapper {

text-align: left;
width: 842px;
vertical-align: top;
background-image: url(../images/mainwrapper_tile.jpg);
background-repeat: repeat-y;
background-position: center;
}

and add
position: relative;

This will make the link position itself relative to the left edge of the main content, irrespective of the window width.
5 Mar 2009, 11:58 AM
#6
salonroyalty avatar

salonroyalty

New Zenner

Join Date:
Feb 2009
Posts:
37
Plugin Contributions:
0

Re: How do I add second link to header image?

I didn't even notice this and when I did, I came back to find the answer and you already had it posted. That's awesome!! Thanks so much! :bigups:

5 Mar 2009, 5:16 PM
#7
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: How do I add second link to header image?

That's a nicely coded solution Glenn and sure beats using an Image Map.

Thanks for sharing.