求助大家
<code>
下面為drupal網站的部分的HTML 原始碼為:
<li class="views-row views-row-1 views-row-odd views-row-first views-row-last list-menucss">
<div class="views-field views-field-field-image">...</div>
<div class="views-field views-field-field--link-index1">...</div>
<div class="views-field views-field-field-link-index">... </div>
<div class="views-field views-field-body">...</div>
<div class="views-field views-field-field-field-content">...</div>
</li>
若為了想分成二列,如何將原始碼從Drupal中調整為下面如增加div:
<li class="views-row views-row-1 views-row-odd views-row-first views-row-last list-menucss">
/* 第一列 */
<div>
<div class="views-field views-field-field-image">...</div>
<div class="views-field views-field-field--link-index1">...</div>
<div class="views-field views-field-field-link-index">... </div>
</div>
/* 第二列 */
<div>
<div class="views-field views-field-body">...</div>
<div class="views-field views-field-field-field-content">...</div>
</div>
</li>
</code>
先糾正你一下
先糾正你一下
div這些屬於HTML的東西
你可以試試看這個能不能做
https://www.drupal.org/project/field_group_views
雖然我都直接寫template比較快
謝謝提供方向
謝謝提供方向
我先嘗試field_group_views
直接寫template可以怎麼下手實作?
先看原始碼
先看原始碼
<li class="views-row views-row-1 views-row-odd views-row-first views-row-last list-menucss">
/* 第一列 */
<div>
<div class="views-field views-field-field-image">...</div>
<div class="views-field views-field-field--link-index1">...</div>
<div class="views-field views-field-field-link-index">... </div>
</div>
/* 第二列 */
<div>
<div class="views-field views-field-body">...</div>
<div class="views-field views-field-field-field-content">...</div>
</div>
</li>
從上述資訊中可以發現這都是在同一個 view-row,所以改 template 反而不是好方法
應該是用「全域:自定文字」(Global: Custom text)來做較佳。
有一個模組叫做
有一個模組叫做
Views Secondary Row
https://www.drupal.org/project/views_secondary_row
或許你也可以試試看