开发者

Drupal - Image Cache and Views for inline background images?

开发者 https://www.devze.com 2023-03-17 02:26 出处:网络
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.

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开发者_如何学C 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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消