开发者

Drupal 7 theming: region error

开发者 https://www.devze.com 2023-03-04 22:22 出处:网络
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

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() p开发者_运维知识库roperly? 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']);
  }
?>
0

精彩评论

暂无评论...
验证码 换一张
取 消