4

I'm surprised I can't find the answer to this online.

I'm currently creating a custom header for my drupal site, so I've created a custom_header region in the .info and a region--custom-header.tpl.php file. Inside the region, I need to add another region.

I've tried to print the other region inside the header region, but nothing is showing up.

Good practise or not aside, how can I do this?

  • 1
    Can't you change the position of region in page.tpl.php? – Sumit Madan Dec 4 '12 at 5:27
  • @SumitMadan Yes I could, and that works. but I have quite a number of page templates so I want to group all regions that belongs to the header inside the header region. – muudless Dec 4 '12 at 5:33
  • If you created any region that will need to be changes in every tpl file. May be this post can help you groups.drupal.org/node/195038. – Sumit Madan Dec 4 '12 at 5:42
  • No You cant do that. – niksmac Dec 4 '12 at 9:25
1

You cant do it that way. But its drupal and it spread true love, so worry not, heres a solution.

  1. Activate php filter under modules

  2. Create a custom block

  3. add <?php print views_embed_view(yourviewname, block); ?>

  • Note: This answer is perfectly valid, but there are risks with enabling PHP Filter, you can read about them here. – No Sssweat Jan 27 '16 at 2:25
0

No You cant do that. Whatever use case you're looking for can be achieved through blocks

0

It's possible, but it'll get hacky and fragile. This sounds like a 'golden hammer' problem, a different tool would likely work better.

Have you considered using Panels or Display Suite to accomplish what you're doing? Panels are better if you want a more WYSIWYG type interface, Display Suite is better if you're comfortable coding.

0

If you don't want to mess with template files or lack coding skills, you can use

Panels

An Overview of Panels The Panels module allows a site administrator to create customized layouts for multiple uses. At its core it is a drag and drop content manager that lets you visually design a layout and place content within that layout. Integration with other systems allows you to create nodes that use this, landing pages that use this, and even override system pages such as taxonomy and the node page so that you can customize the layout of your site with very fine grained permissions.

With Panels, you can add more regions to your nodes.

With mini panels, you can add blocks with regions inside them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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