hi all

I wants to add one region into my other region's block...
i used the same code as we used in page.tpl.
that is print $header
but it is not working
Is there any way to do this?

Comments

marcvangend’s picture

That sounds like a strange workaround for something that could be done differently. Like a snake biting it's own tail...
It is correct that the $header variable is available in page templates only. There is probably another way to achieve what you need... but what exactly are you trying to achieve?

dhvani2511’s picture

thanks

i have one header region and i wants to add menu region into it.
Bcoz i wants to configure my menu as per role so i cant use drupal's menu
now i am using spry menu but i found one another problem that a link in spry menu takes display:block

now if i give padding:0 than also it takes white block.
If you know the solution plase let me know

marcvangend’s picture

Your problem is obviously related to CSS and the HTML structure. Don't start messing with regions. You just need one region and place the block in there. If it isn't displayed correctly, change the CSS and maybe the block's html output.

sumitshekhawat7331’s picture

for creating own regions you have to follow these steps....

Open the template.php file in your theme folder

add this function
unction themeName_regions()
{
return array(
'left' => 'Left sidebar',
'right' => 'Right sidebar',
'content' => 'Content',
'header' => 'Header',
'footer' => 'Footer',
'top_content' => 'Top Content',
);
}

Note : Now just replace 'themeName' with your theme's name.
Now ,open
.info file in your theme's folder, and add the following:
regions[left] = Left sidebar
regions[right] = Right sidebar
regions[content] = Content
regions[header] = Header
regions[footer] = Footer
regions[top_content] = Top Content

and in page.tpl.php
print $top_content; at any location

Cayhn’s picture

Thats for D5 and not for D6 :)

sumitshekhawat7331’s picture

hi...i have used same code in Drupal 6.2 and it works perfectly..