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.
Latest News: (loading..)
Photoshop Header Created - How do I make the buttons clickable?
Started by dgriff, May 01 2012 08:03 PM
2 replies to this topic
#2
Posted 01 May 2012 - 11:09 PM
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
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
Posted 15 June 2012 - 01:18 AM
@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.
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.









