By cdrees on
I'd like to replace the "site name" that is displayed on the theme (I'm currently using the barron theme) with a graphic. It will still be hyperlinked to go home, but I just want the graphical image instead.
I tried modifying page.tpl.php to point to an image, but it's still showing just the sitename using alt="". If I don't add the alt tag, no sitename or graphic is displayed.
Original:
<div id="logoWrapper">
<?php if ($logo) { ?>
<div id="logo"><a href="<?php print $base_path ?>" title="<?php print t('Home') ?>"><img src="<?php print $logo ?>" alt="<?php print t('Home') ?>" /></a></div><?php } ?>
<?php if ($site_name) { ?><div id="siteName"><a href="<?php print $base_path ?>" title="<?php print t('Home') ?>"><?php print $site_name ?></a></div><?php } ?>
<?php if ($site_slogan) { ?><div id="siteSlogan"><?php print $site_slogan ?></div><?php } ?>
</div>
I'm sure this has been done before... any thoughts?
Thanks!!!
Comments
=-=
that looks like stock code from drupal.
what was the code you "tried" to use ?
Stock code
That is the stock code, I was just using it as a point of reference...
What I'm wanting to do is replace this line
So basically instead of showing the site name by default, it references the graphic image instead
=-=
first thing I'd do, is replace the alt with a non php line. to test your theory that the alt is the problem. Thus hardcoding it. you can actually hardcode that entire line if you wanted, since you've already hardcoded the img src
I have a feeling the problem lies with the div you are adding this to ? which you didnt add to your code above. I assume its sitename. which is being controlled by the style.css file.
Go to Administration > Site
Go to Administration > Site Building > Themes > Configure tab
disable Site Name
enable Logo
fill in Path to Custom Logo
no need to code anything.
You Da Man
Thanks Steve!
Replace site name with graphic
The following worked for me.
I use the bluemarine-themplate but I think it will work the same with your theme.
On (url)/themes/barron/page.tpl.php change the following line(s)
OLD:
NEW:
----------
Place a titel_logo on the site in the ../images
The side_name is displayed in the browser and the titel_logo is displayed in the header.
example: http://openwateralkmaar.nl
https://kloebb.nl and https://noww.nl
Of Course it will Work
I have tried this one using a Wabi theme BUT, if the link starts at www.sitename.com/node/xx or anything not included on your pathautho it will not show up. I have tried hardcoding the page.tpl but i have no success. Any idea on this?
=-=
relative urls should be used not absolute. and images for the theme should be placed in the theme folder.