「行スタイルの出力」テンプレートを使用する必要があります(例:views-view-fields.tpl.php)。
ビューに固有にするために、そのセクションに表示されている最後の可能なテンプレート名など、それよりも具体的なテンプレート名を使用することをお勧めしますviews-view-fields--myview--default.tpl.php
。
そこに到達したら、現在の行を追跡するためのグローバル変数が必要になります。たとえば、次のようになります。
<?php
global $is_first_of_term;
if(!isset($is_first_of_term)){
$is_first_of_term = TRUE;
} else {
$is_first_of_term = FALSE;
}
// Then use $is_first_of_term below (unmodified original script)
// to print whatever you want.
?>
<?php foreach ($fields as $id => $field): ?>
<?php if (!empty($field->separator)): ?>
<?php print $field->separator; ?>
<?php endif; ?>
<<?php print $field->inline_html;?> class="views-field-<?php print $field->class; ?>">
<?php if ($field->label): ?>
<label class="views-label-<?php print $field->class; ?>">
<?php print $field->label; ?>:
</label>
<?php endif; ?>
<?php
// $field->element_type is either SPAN or DIV depending upon whether or not
// the field is a 'block' element type or 'inline' element type.
?>
<<?php print $field->element_type; ?> class="field-content"><?php print $field->content; ?></<?php print $field->element_type; ?>>
</<?php print $field->inline_html;?>>
<?php endforeach; ?>