Drupal - 内联背景图像的图像缓存和视图?
我有一个视图,它是一系列图像。我需要将视图的输出作为每个结果的 div,并将图像设置为具有内联样式的背景图像。
如果我如下重写显示的输出,则会创建 div,但没有任何内联样式。
<div class="image-div" style="background-image:url('[field_image_fid]'); width: 250px"></div>
请注意,并不是说样式是他们的,而是不正确的,它们完全被剥离了。通过阅读一些帖子,我认为这是 Drupal 的安全措施,但我不知道如何关闭它。显然,“视图自定义字段”模块是一种解决方法,但它似乎也剥夺了我的字段。
谢谢
I have a View which is a series of images. I need the output of the View to be a div for each result with the image set as a background image with an inline style.
If i rewrite the output of the display as below, the divs are created but without any inline styles.
<div class="image-div" style="background-image:url('[field_image_fid]'); width: 250px"></div>
Note, its not that the styles are their but incorrect, they are completely stripped. From reading some posts I think this is a Drupal security measure, but I dont know how to turn it off. Apparently the Views Custom Fields module is a work around, but it seems to strip my fields also.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以编辑该字段的字段模板,检查基本设置 (D6) 下的主题信息部分,以查看视图模块目录中要使用的模板。将该文件复制到您的主题目录,进行更改并保存,然后重新扫描视图中的模板文件。
You can edit the field template for that field, check the theme information section under Basic Settings (D6) to see which template to use from the Views module directory. Copy that file to your theme directory, make changes and save then rescan the template files in your view.