Latest News: (loading..)

Archived

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

katman1971

Photoshop Header Created - How do I make the buttons clickable?

3 posts in this topic

Hi

 

With version 2.3.1, I have just created a new header in photoshop with buttons (Home, Contact Us, Testimonials, etc). I have sliced up the image. My question is: How do I make the buttons clickable when I upload the new header? I'm sure I have to change some code in the includes/header.php file but I'm not sure what / where to change. Any suggestions? Thanks.

Share this post


Link to post
Share on other sites

You will have to make the images linked to the desired pages.

So for example if you where to link the home button, to the home page you'd do something like this:

 

<?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'button.png') . '</a>'; ?>

 

You will also have to make sure your image is uploaded to the "images" directory or otherwise change the (DIR_WS_IMAGES . to whatever the dictionary with your image is.

 

To do this for other buttons you need to change the FILENAME_DEFAULT to whatever the file name you are linking to, for reference you can use the filenames.php in the /includes folder.

 

Hope that helps.

 

Aleksander

Share this post


Link to post
Share on other sites

@@al3ks

 

Thank you Alexsander. I have one other question. I created two layers: an "active link" and a "non active link" so that when someone hovers over the text, it changes color. How would I work that? Would I edit this code?:

<?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'button.png') . '</a>'; ?>

 

or would I edit the stylesheet? And how would that? Thank you.

Share this post


Link to post
Share on other sites