I'm new at PHP, and I'm trying to redefine the $logo variable, but only for IE. Essentially I want my regular logo to be a PNG graphic with transparency, which won't be supported by IE, so I would like to substitute an alternative logo file for those browsers.
I think I need to introduce a preprocessor function into the template.php, but I'm not entirely sure that is correct. If it is correct I'm obviously not doing it right as I got a parsing error and the site wouldn't load at all. Here's what I've tried to put into template.php (the second half was more or less a guess as I couldn't find anything similar to base it off of).
function marinelli_preprocess_logo(&$vars) {
$vars['logo']=url('sites/default/files/logoalternate.jpg');
}
function marinelli_preprocess_logo(&$vars) {
$vars['logo']=url('sites/default/files/logoalternate.jpg');
}
Any suggestions on how to go about this? Thanks!
Comments
Different Hook
There is no "preprocess_logo" hook. The variable you are looking for is managed via "preprocess_page"
Reference:
http://api.drupal.org/api/function/template_preprocess_page/6
About 1/2 down the list of $variables
---------------------------------
Steven Wright
Slalom
Deleted
Deleted ... missed the second half of your requirement... will get back shortly
http://drupal.org/project/png
http://drupal.org/project/pngfix
extra info
I should have included this link.
http://adaptivethemes.com/transparent-png-images-in-ie6-with-drupal-and-...
Ok I'd try...
in your template.php you need the following:-
or the pngfix as suggested by Martin...it's up to you
Thanks for the suggestion
Thanks everyone for the different suggestions. I couldn't get any of the $logo redefine code to work, but then again I am a complete newb at php.
The pngfix module however seems to work beautifully. I've only tested it so far in FF and IE6, so here's hoping nothing funny happens in the other browsers.
Now on to decipher why the drupal site search doesn't show up in IE...
Thanks!