Php 在drupal7中为图像滑块的视图字段自定义html
我正在使用Drupal7。我正在尝试创建一个包含图像和Vimeo视频的媒体滑块。为此,我创建了一个内容类型,其中一个字段用于图像,另一个字段用于Vimeo链接。我已将字段设置为无限 我正在查看页面中显示我的内容。问题是Drupal为不同的fild类型创建了两个不同的包装器。所有图像都用一个div包装,视频用另一个div包装 但是我想要每件东西都有一个包装,每件东西都有一个包装。 例如:Php 在drupal7中为图像滑块的视图字段自定义html,php,html,drupal,drupal-7,slider,Php,Html,Drupal,Drupal 7,Slider,我正在使用Drupal7。我正在尝试创建一个包含图像和Vimeo视频的媒体滑块。为此,我创建了一个内容类型,其中一个字段用于图像,另一个字段用于Vimeo链接。我已将字段设置为无限 我正在查看页面中显示我的内容。问题是Drupal为不同的fild类型创建了两个不同的包装器。所有图像都用一个div包装,视频用另一个div包装 但是我想要每件东西都有一个包装,每件东西都有一个包装。 例如: <div class="slider"> <div class="item">
<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>
,
,
请注意,您还需要根据您希望模板应用的范围(即仅页面或仅块等)和刷新缓存(创建文件后单击“重新扫描”)选择正确的模板文件名。感谢您的帮助!它帮助我删除一些额外的html元素。我的问题还在于Devel模块在代码中添加了额外的span标记。