Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By wolfgan on
Hello! I use a Drupal 7. I have two blocks in a header region and need to display them like it is shown in a code below
<div class="header">
<div class="header-top">
<div class="ca-r">
Here I need to display a first block
</div>
</div><!-- header-top -->
<nav class="navbar navbar-default">
Here I need to display a second block
</nav>
</div><!-- header -->
This code from a region--header.tpl.php
Comments
Hope you have created header
Hope you have created header region for your theme.
You can assign block to header region through admin interface.
1. Logged in as admin.
2. Goto "admin/structure/block" assign block to required region.
Yes I've done
I have a header region in my theme and I have two blocks assigned to this region through an admin interface. I themed a header in a region--header.tpl.php, and I need show my blocks in separate places of the region. Blocks I themed too through tpl files. Into the region I have access to a $content variable that displays only both blocks together. How to do output for every block separately?
In same region if your
In same region if your assigning any number of blocks, its get printed by $content variable only. However while rendering block in region drupal will have unique wrapper div.
You can check your unique wrapper div using firebug, If you want add any custom class for theming pls use Block Class moudle to achieve the same.
Thanks
arulraj thank for your reply