因此,目前如果我创建一个输出三篇文章及其标题和正文字段的视图,则 html 结构的清理版本将是:
<div class="item-1">
<div class="title">Item One Title</div>
<div class="body">Blah Blah Blah......</div>
</div>
<div class="item-2">
<div class="title">Item Two Title</div>
<div class="body">Blah Blah Blah......</div>
</div>
<div class="item-3">
<div class="title">Item Three Title</div>
<div class="body">Blah Blah Blah......</div>
</div>
任何人都知道我可以如何通过 Views 或最佳替代方案来制作这样的结构:
<div class="titles">
<div class="title1">Item One Title</div>
<div class="title2">Item Two Title</div>
<div class="title3">Item Three Title</div>
</div>
<div class="bodies">
<div class="body1">Blah Blah Blah......</div>
<div class="body2">Blah Blah Blah......</div>
<div class="body3">Blah Blah Blah......</div>
</div>