【问题标题】:Drupal 7 displaying content issueDrupal 7 显示内容问题
【发布时间】:2015-02-24 06:13:04
【问题描述】:

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

【问题讨论】:

    标签: drupal-7


    【解决方案1】:

    在您的模板中,您可以使用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>
    

    【讨论】:

    • Thanku @reallyxloco 但我通过使用下面的代码得到了溶胶....................... .$body = field_get_items('node',$node, 'body');
    猜你喜欢
    • 2015-12-04
    • 1970-01-01
    • 1970-01-01
    • 2021-04-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-01
    • 1970-01-01
    相关资源
    最近更新 更多