En Drupal 7, he creado una Vista que enumera varios campos. Los campos se agrupan por otro campo (el término ID del campo). El marcado se ve así:
<h3>[Term 1]</h3>
<div class="views-row views-row-1 views-row-odd views-row-first"> [Field Content] </div>
<div class="views-row views-row-2 views-row-even"> [Field Content] </div>
<div class="views-row views-row-3 views-row-odd views-row-last"> [Field Content] </div>
<h3>[Term 2]</h3>
<div class="views-row views-row-1 views-row-odd views-row-first"> [Field Content] </div>
<div class="views-row views-row-2 views-row-even"> [Field Content] </div>
<div class="views-row views-row-3 views-row-odd views-row-last"> [Field Content] </div>
<h3>[Term 3]</h3>
<div class="views-row views-row-1 views-row-odd views-row-first"> [Field Content] </div>
<div class="views-row views-row-2 views-row-even"> [Field Content] </div>
<div class="views-row views-row-3 views-row-odd views-row-last"> [Field Content] </div>
Sin embargo, necesito la marca para que se vea así:
<div id="term_1">
<h3>[Term 1]</h3>
<div class="views-row views-row-1 views-row-odd views-row-first"> [Field Content] </div>
<div class="views-row views-row-2 views-row-even"> [Field Content] </div>
<div class="views-row views-row-3 views-row-odd views-row-last"> [Field Content] </div>
</div>
<div id="term_2">
<h3>[Term 2]</h3>
<div class="views-row views-row-1 views-row-odd views-row-first"> [Field Content] </div>
<div class="views-row views-row-2 views-row-even"> [Field Content] </div>
<div class="views-row views-row-3 views-row-odd views-row-last"> [Field Content] </div>
</div>
<div id="term_3">
<h3>[Term 3]</h3>
<div class="views-row views-row-1 views-row-odd views-row-first"> [Field Content] </div>
<div class="views-row views-row-2 views-row-even"> [Field Content] </div>
<div class="views-row views-row-3 views-row-odd views-row-last"> [Field Content] </div>
</div>
Sé que puede usar views-view-unformatted.tpl.php (Style Output) para anular la vista y luego insertar un DIV para envolver el grupo.
Sin embargo, necesito que mi envoltorio DIV sea así <div id="term_ID_{number of ID}">
. La identificación del número corresponderá al término que se ha utilizado para agrupar los campos. De manera predeterminada, si usa views-view-unformatted.tpl.php, no puede insertar tokens para ID de término en él.
Cualquier ayuda sería apreciada.