Drupal 7显示内容问题

时间:2015-02-24 06:13:05

标签: drupal-7

如何隐藏基本页面内容类型的特定字段?不是来自管理平台结构>内容类型>基本页面>管理显示..我想隐藏它在我的页面模板然后分开显示,以便我可以自定义它?

1 个答案:

答案 0 :(得分:0)

在模板中,您可以使用hide function来阻止呈现字段。

以下是Garland主题节点模板的示例:

  <div class="content clearfix"<?php print $content_attributes; ?>>
    <?php
      // We hide the comments and links now so that we can render them later.
      hide($content['comments']);
      hide($content['links']);
      print render($content);
    ?>
  </div>

  <div class="clearfix">
    <?php if (!empty($content['links'])): ?>
      <div class="links"><?php print render($content['links']); ?></div>
    <?php endif; ?>

    <?php print render($content['comments']); ?>
  </div>