Never mind, found the problem. The drupal_get_path call is wrong. I am using $GLOBALS['base_path'] now instead, and all is fine. Ursula<br><br><div class="gmail_quote">On Fri, Aug 24, 2012 at 5:50 PM, Ursula Pieper <span dir="ltr"><<a href="mailto:dramamezzo@gmail.com" target="_blank">dramamezzo@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">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" target="_blank">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/" target="_blank">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" target="_blank">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/" target="_blank">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" target="_blank">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/" target="_blank">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" target="_blank">http://example.com/sites/all/themes/mytheme/images/second_logo.png</a><br>
<br>
instead of<br><br><a href="http://example.com/" target="_blank">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>
</blockquote></div><br>