2015-02-24 122 views
0

如何隱藏基本頁面內容類型的特定字段?不是從管理員的pannel結構>內容類型>基本頁面>管理顯示..我想隱藏在我的頁面模板,然後顯示分離,以便我可以自定義它?Drupal 7顯示內容問題

回答

0

在您的模板中,您可以使用hide function來防止字段被渲染。

這裏有一個從加蘭主題的節點模板所示例:

<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> 
+0

Thanku @reallyxloco但我用下面的代碼得到了溶膠.................. ..... .' $ body = field_get_items('node',$ node,'body');' – nomeer 2015-02-25 09:19:09