I've got screenlists for videos and I need to put them into the div tag to as a background and then change bacgkround position with JS to show the preview. I've downloaded Image URL Formatter for this purpose and added code to "Rewrite Results" field of the field in my view:

<div class="episode-screenshot" style="background-image: url('[field_episode_screenlist]');"></div>

But there is no such attribute "style" in rendered html of the page. Does Views module block it?


1 Answer 1


Yes, Views does block style attribute for security reasons. Class attribute is allowed.

Here's one long discussion about it https://drupal.org/node/853880 and some other ideas for workarounds Add style attribute to view fields.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.