I'm trying to use this theme but can't figure out how to display the site logo.

I tried the page header in page elements. It displays the slogan, the search box as well, but not the logo. Do you have a clue about that ?

I have a logo.png in my theme folder, it is activated in the theme settings. Is use domain access to handle themes, but I think the themes are well configured. I use AT admin as admin theme and the logo is right there on admin pages.

Thanks for your attention.
And thank you Jeff Burnz for AT, I really enjoy it.

#6 elephant_site_panels_everywhere.zip89.13 KBJeff Burnz
Members fund testing for the Drupal project. Drupal Association Learn more


Jerome F’s picture

Adding the following in page.tpl.php works too.
<span id="logo"><?php print $linked_site_logo; ?></span>

Then adding all the content of pane-header.tpl.php in page.tpl.php works too :

<div id="header" class="clearfix">
  <?php if ($linked_site_logo or $linked_site_name or $site_slogan): ?>
    <div id="branding">
      <?php if ($linked_site_logo or $linked_site_name): ?>
        <?php if ($title): ?>
          <div class="logo-site-name"><strong>
            <?php if ($linked_site_logo): ?><span id="logo"><?php print $linked_site_logo; ?></span><?php endif; ?>
            <?php if ($linked_site_name): ?><span id="site-name"><?php print $linked_site_name; ?></span><?php endif; ?>
        <?php else: /* Use h1 when the content title is empty */ ?>
          <h1 class="logo-site-name">
            <?php if ($linked_site_logo): ?><span id="logo"><?php print $linked_site_logo; ?></span><?php endif; ?>
            <?php if ($linked_site_name): ?><span id="site-name"><?php print $linked_site_name; ?></span><?php endif; ?>
        <?php endif; ?>
      <?php endif; ?>
      <?php if ($site_slogan): ?>
        <div id="site-slogan"><?php print $site_slogan; ?></div>
      <?php endif; ?>
    </div> <!-- /branding -->
  <?php endif; ?>
  <?php if ($search_box): ?>
    <div id="search-box"<?php print $toggle_label ?>><?php print $search_box; ?></div> <!-- /search box -->
  <?php endif; ?>
</div> <!-- /header --> 

So I wonder if that means that pane-header.tpl.php isn't taken into account ?

Jerome F’s picture

Priority: Normal » Minor
Status: Active » Closed (fixed)

It happens to be just a syntax error in the name of my template in the functions.
Sorry for that.

Edit : it doesn't solve the problem.

Jerome F’s picture

Priority: Minor » Normal
Status: Closed (fixed) » Active

I had to use the code provided by panels everywhere (1), because the code in AT panels everywhere (see #1) doesn't display the logo.
I'm not a php coder, that's why I don't understand what this code is supposed to return.
Strange though, that in a preview in panels the logo shows up along with the search box, etc. And all these don't show up on the actual page. Just as if logo was empty.

1) in pane-header.tpl.php

<?php if (!empty($logo)): ?>
  <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home" id="logo">
    <img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" />
<?php endif; ?>

1) in template.php

function elephant_site_panels_everywhere_preprocess_pane_header(&$vars) {
   // set the page title var
   $vars['title'] = ctools_set_variable_token('title');
    $vars['site_name'] = ctools_set_variable_token('site_name');
	$vars['site_slogan'] = ctools_set_variable_token('site_slogan');
	$vars['front_page'] = url();
	$vars['logo'] = ctools_set_variable_token('logo');
	$vars['search_box'] = ctools_set_variable_token('search_box'); 
Jeff Burnz’s picture

I have just been messing about with this and I had to clear the theme registry then everything shows up as per normal.

Jerome F’s picture

Status: Fixed » Active

That is so confusing. It works fine in AT panels everywhere, but not in the custom theme I created based on it.
Clearing the theme registry doesn't help.

My function is called OK i think (from template.php) :

function elephant_site_panels_everywhere_preprocess_pane_header(&$vars) {
   // set the page title var
   $vars['title'] = ctools_set_variable_token('title');
  // Set variables for the logo and site_name.
  if (!empty($vars['logo'])) {
    // Return the site_name even when site_name is disabled in theme settings.
    $vars['logo_alt_text'] = variable_get('site_name', '');
    $vars['linked_site_logo'] = '<a href="'. $vars['front_page'] .'" title="'. t('Home page') .'" rel="home"><img src="'. $vars['logo'] .'" alt="'. $vars['logo_alt_text'] .' '. t('logo') .'" /></a>';
  if (!empty($vars['site_name'])) {
    $vars['linked_site_name'] = '<a href="'. $vars['front_page'] .'" title="'. t('Home page') .'" rel="home">'. $vars['site_name'] .'</a>';

  // Hide search theme form label
  if ($vars['search_box'] && theme_get_setting('display_search_form_label') == 0) {
    $vars['toggle_label'] = ' class="hide-label"';

Is my issue related to the folder where I put my custom theme ?

The path to adaptative theme : sites/all/themes/adaptivetheme/adaptivetheme
The path to my custom theme : sites/all/themes/elephant/elephant_site_panels_everywhere

I guess not because my admin custom theme is there as well and the logo is displayed : sites/all/themes/elephant/elephant_corporate_at_admin
And even if my custom theme is in the same directory, the logo doesn't shows up either.

For the moment I have to use the default pane-header.tpl.php and preprocess function as the AT ones breaks the logo and I don't know why.

Perhaps it's easier to reproduce this behavior if I make a copy of my theme folder available (edit : removed)

It could also be related to this issue :

Jeff Burnz’s picture

Thanks for adding the theme files, that made it very easy for me to find the issues.

There were two issues really:

1) the info file was incorrectly named elepnant_ instead of elephant_
2) you had a direct copy of the theme inside the theme, which I think was causing some issues.

I have attached the fixed theme - make sure you remove your current theme completely and then add this one, this is only the elephant_site_panels_everywhere theme.

You probably want to switch theme before making the change (and disable the elepnant theme) otherwise you're going to get a lot of big red errors.

Just a side note: when ever you are using AT and you go to your subthemes settings page and you don't see the advanced theme settings, you know something is wrong with either the info file or the theme_settings.php file, its always a flag that there's probably a typo somewhere.

Jerome F’s picture

Status: Active » Fixed

Omg, that's right I'm sorry. I should have noticed it was so obvious. Thank you very much for your help.
I definitely shall double check for these typo when something's wrong.

Everything works now I mark this fixed.

Jeff Burnz’s picture

Status: Active » Fixed

Your welcome, and don't sweat it, we've all been there done that, its always the most obvious things you forget to check for, its just that I've done it SO often I know what to look out for, lol.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.