In Drupal 7 habe ich eine Ansicht erstellt, die mehrere Felder auflistet. Die Felder werden nach einem anderen Feld gruppiert (der Term-ID des Feldes). Das Markup sieht so aus:
<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>
Ich brauche jedoch die Markierung, um so auszusehen:
<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>
Ich weiß, dass Sie views-view-unformatted.tpl.php (Style Output) verwenden können, um die Ansicht zu überschreiben und dann einen DIV einzufügen, um die Gruppe zu schließen.
Allerdings muss ich meine Wrapper DIV so sein <div id="term_ID_{number of ID}">
. Die Nummern-ID entspricht dem Begriff, der zum Gruppieren der Felder verwendet wurde. Wenn Sie views-view-unformatted.tpl.php verwenden, können Sie standardmäßig keine Tokens für Term-IDs einfügen.
Jede Hilfe wäre dankbar.