您在這裡

views css的問題

Alma's 的頭像
Alma 在 2014-11-03 (週一) 16:08 發表

求助大家
<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>

先看原始碼

<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)來做較佳。