0

I am placing a couple of static elements into the header, the issue is that the elements are being placed below the menu instead of below the header logo. Is this possible to put the block below the header logo image? I had to hack the css with a negative left margin and absolute top for now but it does not behave properly when elements are declared above it. (e.g. if admin logs in, or is not logged in, will affect the position vertically, etc)

1 Answer 1

0

If you are trying to place some block below the site logo, there should be a region below it. CSS come later.

If your block is going below menu, that means the region where you are placing are rendered below menu in the page.tpl.php

You have two choice here - either render the same region just after site logo or create another region in there.

Open your page.tpl.php & try to find -

<?php if ($logo): ?>
  /*more text*/
<?php endif; ?>

Render your region just after it (assuming your region name is header) --

<?php print render($page['header']); ?>

You can add DIV class or ID according to your need around it or do it in if-else, like -

<?php if ($page['header']): ?>
  <div class="header" > 
    <?php print render($page['header']); ?>
  </div>
<?php endif; ?>

You can add your own region in theme.info file if you don't want to use the same where you were trying to place your static content.

1
  • Ah ok, that makes a bit more sense programatically. Wasn't sure if I could use the cms to render the block below the site logo or if I had to code it into the theme. When I put the block in header for all pages it renders below the menu so I had to hack the css to move it left. Thanks for your helpful answer!
    – DWils
    Aug 8, 2013 at 17:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.