I am learning how to adapt an existing theme (Zen 960 sub theme). Our branding requires two logos in the header. Both logos need to be clickable and linked to different URLs. I am already using css to put a background image behind the logos. I have altered the page.tpl file to call a new variable $u_logo. How do I add this new variable to the database and get Drupal to recognize it?

<div id="headerLeft" class="grid-8 alpha clear-block">
      	 <a href="http://www.utah.edu"><img src="<?php print $u_logo; ?>" alt="The University of Utah" width="70" height="65" border="0" /></a>
         <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'); ?>" />
          </a>
       <!-- end headerLeft -->
      </div>

Any help would be appreciated.

Comments

anghor’s picture

I'm totally beginner but in my case for every missing element, I'm building block with CKK and Views module. I believe this is lame, but right now is the only way that I can solve issues like that.

mndonx’s picture

You could make another variable for your page.tpl.php file in the preprocess_page function in your template.php file.

For instance in template.php:

function THEME_preprocess_page(&$vars, $hook) {
    $vars['u_logo'] = $base_path . path_to_theme() .'/images/u_logo.png';
}

You wouldn't be adding the second logo to your database, though. The image file would live in your theme folder.