Thanks Allen! It's really nice of you to offer and I do appreciate the help. The template I'm using is Twist of Nature, found HERE. My site doesn't look remotely like that due to all the customization but that is it. :)
Thanks Allen! It's really nice of you to offer and I do appreciate the help. The template I'm using is Twist of Nature, found HERE. My site doesn't look remotely like that due to all the customization but that is it. :)
Greetings,
I must admit that my coding skills are about non-existant; I know just enough to make some basic adjustments. However, I did find out why you couldn't find the suggested code and that is because of the switching code that your template uses to change header images from page to page; it replaced the code you would otherwise put the link in. Since the replacement code pushes the images themselves off to the CSS file, I don't think you can just stick a link in that part of the php file and make the whole header pic a link. However, if you don't mind using javascript, I found a possible solution. Try replacing this code in the tpl_header.php file:
with this:PHP Code:<!--bof-branding display-->
<div id="<?php
$page = $_GET['main_page'];
$cPath = $_GET['cPath'];
if ($page == "index" && $cPath < 1 )
{ echo "logoWrapper"; }
else
{ echo "logoWrapper".rand ( 1 , 6 ); }
?>">
The only change is the javascript just before the very last '>'.PHP Code:<!--bof-branding display-->
<div id="<?php
$page = $_GET['main_page'];
$cPath = $_GET['cPath'];
if ($page == "index" && $cPath < 1 )
{ echo "logoWrapper"; }
else
{ echo "logoWrapper".rand ( 1 , 6 ); }
?>" onclick="location.href='http://www.gardenofshadows.ca';" style="cursor:pointer;">
As usual, make a copy of the original code before making these changes just in case it doesn't do what you want.
By the by, I found the suggestion at: http://www.ajaxprojects.com/ajax/tut...php?itemid=223
--Allen
PS. the one downside that I can see is if people have JS turned off on their browsers, the link won't work.
Hey Allen, it worked! Thanks so much for all the work you put into helping me. I really, really appreciate it. And if it doesn't work with JS turned off, no harm, no foul, right? It just remains status quo in that case. So, thanks again!![]()
"Since the replacement code pushes the images themselves off to the CSS file, I don't think you can just stick a link in that part of the php file and make the whole header pic a link."
Actually, you can just add back the link code - all the given code does is decide what classname the div will have. Put the link in just after the complete opening div tag:PHP Code:<!--bof-branding display-->
<div id="<?php
$page = $_GET['main_page'];
$cPath = $_GET['cPath'];
if ($page == "index" && $cPath < 1 )
{ echo "logoWrapper"; }
else
{ echo "logoWrapper".rand ( 1 , 6 ); }
?>">
<?php if (HEADER_SALES_TEXT != '' || (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2))) { ?>
<div id="taglineWrapper">Then add to your stylesheetPHP Code:<!--bof-branding display-->
<div id="<?php
$page = $_GET['main_page'];
$cPath = $_GET['cPath'];
if ($page == "index" && $cPath < 1 )
{ echo "logoWrapper"; }
else
{ echo "logoWrapper".rand ( 1 , 6 ); }
?>">
<?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '" id="logoLink"> </a>'; ?>
<?php if (HEADER_SALES_TEXT != '' || (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2))) { ?>
<div id="taglineWrapper">
#logoLink {display: block; height: 123px;}
Adjust height to taste.
There could be slight modifications to this depending on what elements you want to include in the background link area.
Last edited by gjh42; 24 Jan 2011 at 04:39 PM.
gjh42,
Thanks for the info. I had thought of doing that. However, since the CSS code applies the background-image attribute to the div tag, would not adding the image code back into the php cause there to be two images and possibly defeat the classname-based image switcher since the 2nd image would be on top of the background image?
--Allen
Nyx1961,
You are most welcome. I'm gratified that I was able to help.
--Allen
Since the link is an empty <a> element (except for the no-break space in case IE gets picky), it will spread over the containing div transparently. It will not interfere in any way with the background switching. There is no image code added back in my example.
gjh42,
Ok. I get it now. My php ignorance was showing. Now that I look at it I do see that there is no code to insert an actual image.
Thanks,
--Allen