Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By BaliuxXx on
How to get drupal logo path? Where is it stored in DB?
Comments
Right-click it
Select "view image", and then you'll see the path.
The exact location of the logo is set by your theme, so it may vary a bit from theme to theme, but it's generally in the theme folder.
Firebug is your friend, and will let you trace this and many other issues.
:)
Stay away from the DB
Do not poke around in the database for such information. Use the documented API.
The template system makes $logo available to page.tpl.php.
http://api.drupal.org/api/drupal/modules--system--page.tpl.php
http://api.drupal.org/api/function/template_preprocess_page/6
http://api.drupal.org/api/function/theme_get_setting/6
if you uploaded a new logo (not the logo fom the default theme)
l
Orrrrrr....
print theme_get_setting('logo');
That function does all the theme identifying and data fetching stuff for you and returns the key required (in the example above, it's the equivalent of skipping everything out and jumping right to the
$settings['logo_path']
step).If you really want you can use
theme_get_setting('logo_path')
, but that'll get you the manually-set logo path regardless of whether the theme is set to use it - if the theme is configured to use logo_default you're boned. 'logo' will return whichever of those paths the theme is currently using.++Andy
Developing Drupal websites for Livelink New Media since 2008
This worked for me. Tx! And
This worked for me. Tx! And you might need to set the theme in second parameter
Logo Path
Hi,
This code works well, pls try,
global $theme_key;
$logo_url = theme_get_setting('logo_path', $theme_key);
print $logo_url;
global
You don't need to declare or pass in your global $theme_key - if no second parameter is provided, the theme_get_setting() function assumes it's the current theme.
++Andy
Developing Drupal websites for Livelink New Media since 2008
This will help to get & set
This will help to get & set logo of your theme.