I am trying to add an additional logo to my D7 site. <br>I added to the template.php the following:<br><br>function mytheme_preprocess_page(&$variables, $hook) {<br> $theme_path = drupal_get_path('theme', variable_get('theme_default', NULL));<br>
$variables['second_logo'] = $base_path . '/' . $theme_path . '/images/second_logo.png';<br>}<br><br>and on page.tpl.php, I use the variable $second_logo, which correctly goes to:<br><a href="http://example.com/drupal_site/sites/all/themes/mytheme/images/second_logo.png">http://example.com/drupal_site/sites/all/themes/mytheme/images/second_logo.png</a><br>
<br>This works fine for the home page:<br><br><a href="http://example.com/">http://example.com/</a><b>drupal_site</b>/sites/all/themes/mytheme/images/second_logo.png<br><br>However, when I am looking at a content page:<br>
<a href="http://example.com/drupal_site/content/whateverpage">http://example.com/drupal_site/content/whateverpage</a><br><br>The url for the second logo gets constructed as:<br><a href="http://example.com/drupal_site/">http://example.com/drupal_site/</a><b>content</b>/sites/all/themes/mytheme/images/second_logo.png<br>
<br>So, I add the base path to template.php:<br><br>$base_path = drupal_get_path('theme', variable_get('base_path', NULL));<br>$theme_path = drupal_get_path('theme', variable_get('theme_default', NULL));<br>
$variables['second_logo'] = $base_path . '/' . $theme_path . '/images/second_logo.png';<br><br>base_path, according to <a href="http://api.drupal.org/api/drupal/globals/7">http://api.drupal.org/api/drupal/globals/7</a> is supposed to bet the base of the Drupal installation, which in my case is <a href="http://example.com/drupal_site/">http://example.com/drupal_site/</a><br>
<br>However, the path for the second logo gets constructed as:<br><a href="http://example.com/sites/all/themes/mytheme/images/second_logo.png">http://example.com/sites/all/themes/mytheme/images/second_logo.png</a><br><br>
instead of<br><br><a href="http://example.com/">http://example.com/</a><b>drupal_site</b>/sites/all/themes/mytheme/images/second_logo.png<br> <br> D7.15, zen 7.15 sub-theme. <br><br>What am I don't wrong? <br><br>Thanks, Ursula<br>