I am attempting to render a menu assigned to a block right next to the body of a custom content type. I am using Drupal 7.

I have a custom region defined within my template .info file. I would like to render this region and the block assigned to it from within a custom node template ...

node--<my custom content type>.tpl.php

I needed to do this within the custom node template because I needed to break out the individual fields of the content type rather than just using

print render($content);

This is what I was trying to do ...

<div class="content">
    print render($content['title']);
    print render($content['field_banner_image']);
    print render($content['body']);
  <div><?php print render($page['MY-CUSTOM-REGION']); ?></div>
  <div><?php print render($content['body']); ?>div>

However, my menu block does not render and I get the following error ...

Warning: Cannot use a scalar value as an array in include()[PATH TO MY CUSTOM NODE TEMPLATE]

Is it possible to render a region from within a custom node template?

  • 1
    I found a solution from drupal.stackexchange.com/questions/20054/…. Basically I need to add a function to the template.php file for my theme. Once I did that the node tamplate was "aware" of my custom region and I was able to render it. The above article has a very thorough and detailed explanation.
    – webworm
    Nov 23, 2012 at 15:22
  • 1
    could you post your solution as an answer and check it? it will hep others to identify quickly the solution :)
    – cayerdis
    Nov 23, 2012 at 15:58
  • 1
    @cayerdis don't repost answers, mark as duplicate.
    – Mołot
    Jul 12, 2013 at 8:13

1 Answer 1


You should load your menu yourself inside node, use:

  1. hook_node_load
  2. hook_node_view
  3. hook_preprocess_node

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