我有一個自定義內容(使用cck)即thewittyshit,它有一個字段field_thewittyshit。我想爲所有視圖主題field_thewittyshit字段。我寫了下面的代碼並將其保存在一個新文件中,即views-view-field-default -field-thewittyshit-value.tpl.php。但是仍然沒有任何變化反映在我的任何視圖或節點顯示中。在Drupal-6中構建字段
<?php
// $Id: views-view-field.tpl.php,v 1.1 2008/05/16 22:22:32 merlinofchaos Exp $
/**
* This template is used to print a single field in a view. It is not
* actually used in default Views, as this is registered as a theme
* function which has better performance. For single overrides, the
* template is perfectly okay.
*
* Variables available:
* - $view: The view object
* - $field: The field handler object that can process the input
* - $row: The raw SQL result that can be used
* - $output: The processed output that will normally be used.
*
* When fetching output from the $row, this construct should be used:
* $data = $row->{$field->field_alias}
*
* The above will guarantee that you'll always get the correct data,
* regardless of any changes in the aliasing that might happen if
* the view is modified.
*/
?>
<em>
<?php print $output; ?>
<em/>
我想格式化文本。在這段代碼中,我只是使它以斜體顯示。