Jump to content



Photo

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


This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1   dgriff

dgriff
  • Members
  • 351 posts

Posted 01 May 2012 - 20:03

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.

#2   al3ks

al3ks
  • Members
  • 288 posts

Posted 01 May 2012 - 23:09

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
Find this post helpful? Click the 'Like this' button. :)

#3   dgriff

dgriff
  • Members
  • 351 posts

Posted 15 June 2012 - 01:18

@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.