Reputation: 55
I'm new to Drupal and to PHP, all I need to do is change the image file for the logo in my header. I've found my page.tpl.php, and the line for the link, but I don't understand what $logo is referencing. What file is it pointing to? How to I find it and change the file?
Thanks, in advance.
Upvotes: 1
Views: 637
Reputation: 35
If you are using default theme, you can change your logo at [your project folder>themes>your theme>logo.png] If you are using custom theme, you can change at [your project folder>sites>all>themes>your themes>logo.png]
$logo is referencing to logo.png on those directories.
Upvotes: 0
Reputation: 99
You should not do that in page.tpl.php. Just login to your site, choose appearance => choose your active theme => settings => upload file => go to your file and click upload => save.
Drupal will automatically set $logo to the place it uploaded your logo (somewhere in your public folder). It is important for your theme to use this variable in order to show it on your website. Since you found the variable in your page.tpl.php file, that should be fine.
If you really want to change the file rather than use the proposed method, do this method once and simply search for the logo file in your public folder. Next time you can overwrite this file. You should not overwrite the default Drupal logo.
An even better way to get it is by opening the source code when looking at your webpage (your browser provides this, you can also use a tool like firebug) and search for the "header" id. On the next lines you should find the relative path to the image file that is currently used.
Upvotes: 1
Reputation: 96
It's point to your {your_theme}/logo.png. But if system cannot find that png file on your theme. It will use default logo, for example: themes/bartik/logo.png.
Upvotes: 1