简体   繁体   中英

Drupal 7 theming: region error

this is in my theme.info file of my Drupal theme:

regions[conf_modules] = Configurator: modules

I'm using multiple templates for different node types. In one of them I'd like this region/block to show up. So I've put this in node--configurator.tpl.php:

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

In the Drupal administration panel I have assigned a views block to the region, but on the node--configurator.tpl.php pages, the views block is not shown. Am I using render() properly? What's going wrong here? Thanks in advance!

In node templates, $page is simply a status variable that is:

True if the node is being displayed by itself as a page.

However, you can add regions to the page for specific content types through your page.tpl.php if you like. Something like below should work if placed in page.tpl.php :

<?php
  if ($node->type == 'CONTENT_TYPE') {
    print render($page['conf_modules']);
  }
?>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM