2011-07-04 57 views
1

我試圖覆蓋我的頁面的輸出,所以我可以添加一些PHP代碼,但FiveStar模塊只給出2個選項,它低於或高於內容。這是我的問題,因爲我想將它包含在我的HIDE技術中,然後我可以選擇放置它的位置。Drupal 7手動訪問FiveStar模塊

例如(我躲在我的所有輸出呈現內容之前,再後來我可以使每一個爲我選擇,我無法找到渲染五星的Widget)

hide($content['comments']); 
    hide($content['links']); 
    hide($content['field_location']); 
    hide($content['body']); 
    hide($content['field_filename']); 
    hide($content['fivestar_widget']); 

    print render($content); 

如果任何一個可以在空白的我填將真棒! t。

回答

1

如果您將小部件放置在<?php print render($content) ?>之後,則必須在呈現$ content之前使用<?php hide($content['fivestar_widget_vote']); ?>。否則只需使用<?php print render($content['fivestar_widget_vote']); ?>。如果在此之前,則打印的屬性將設置爲true,並且只會呈現一次。

+0

我可以吻你!這正是我一直在尋找的,幾天!你能否進一步向我指出我如何找到這些變量的方向。即「fivestar_widget_vote」,「鏈接」等。 – Purplemonkey

+0

使用Devel模塊,您可以使用dsm($ vars)函數將變量打印到屏幕上。我使用PhpED IDE,花費幾百美元,但真正使調試和開發成爲可能。 –