我使用的是Drupal7,我正在尝试创建一个带有图片和Vimeo视频的媒体滑块。为此,我创建了一个内容类型,其中一个字段用于图像,另一个字段用于Vimeo-links。我已将字段设置为无限制。
我正在视图页面中显示我的内容。问题是Drupal为不同的fild-type创建了两个不同的包装器。所有图像都包装在一个div中,而视频则包装在另一个div中。
但我希望每样东西都有一个包装器,每个项目都有一个包装器。例如:
<div class="slider">
<div class="item">
<img typeof="foaf:Image" src="image.jpg" width="658" height="420" alt="">
</div>
<div class="item">
<img typeof="foaf:Image" src="image2.jpg" width="658" height="420" alt="">
</div>
<div class="item">
<iframe title="Video title" src="http://myVideoLink?color=cccccc" frameborder="0" width="658" height="420" id="vimeo-player"></iframe>
</div>
<div class="item">
<iframe title="Video title" src="http://myVideoLink2?color=cccccc" frameborder="0" width="658" height="420" id="vimeo-player"></iframe>
</div>
</div>而不是这样:
<div class="views-field views-field-field-image">
<div class="field-content">
<span thmr="thmr_3">
<span thmr="thmr_4">
<span thmr="thmr_5">
<img typeof="foaf:Image" src="image.jpg" width="658" height="420" alt="">
</span>
</span>
</span>
,
<span thmr="thmr_6">
<span thmr="thmr_7">
<img typeof="foaf:Image" src="image2.jpg" width="658" height="420" alt="">
</span>
</span>
</div>
</div>
<div class="views-field views-field-field-vimeo">
<div class="field-content">
<span thmr="thmr_10">
<iframe title="Video title" src="http://myVideoLink?color=cccccc" frameborder="0" width="658" height="420" id="vimeo-player"></iframe>
,
<iframe title="Video title" src="http://myVideoLink2?color=cccccc" frameborder="0" width="658" height="420" id="vimeo-player"></iframe>
</div>
</div>发布于 2012-09-02 21:45:35
请注意,您还需要根据您希望模板应用的范围(即仅页面或仅块等)和刷新缓存(创建文件后单击“重新扫描”)来选择正确的模板文件名。
https://stackoverflow.com/questions/12236275
复制相似问题