Closed (fixed)
Project:
Views (for Drupal 7)
Version:
7.x-3.0-rc1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Feb 2011 at 19:26 UTC
Updated:
16 Oct 2011 at 05:51 UTC
Use of inline css such as style="background: #f00; etc is stripped from global text on render. I was hoping to use a replacement value to allow me to apply a cck field image url as the background of a div via an inline style but found any and all style attributes stripped from the div on render.
Screenshot attached of example.
| Comment | File | Size | Author |
|---|---|---|---|
| 2011-02-28_1425.png | 54.39 KB | Matt Giacomazzo |
Comments
Comment #1
dawehnerCurrently this is stripped out.
We might support input formats there.
In the meantime you can use http://drupal.org/project/views_customfield to provide any kind of output.
Comment #2
iamjon commentedMarking as closed as workaround offered.
Comment #3
jdln commentedI need to do the same thing but when I use Views Custom Field the exact same thing happens. Ive tried Markup and PHP code.
Thanks
Comment #4
dawehnerOkay then please use .css files and classes.
if you really need it you can use field templates.
Comment #5
jdln commentedSo this can't be done with Views Custom Field? I can do it with template but keeping everything in the UI would be a bit easier.
Comment #6
merlinofchaos commentedNo you cannot, for security reasons. You can with Views PHP Field module.
Comment #7
jdln commentedDo you mean the PHP code field for the Views Custom Field module? This doesn't seem to work for me.
Thanks
Comment #9
jason@greengeckodesign.com commentedSo if we want to inject a little inline css (in situations where a class won't cut it because we are using user generated content such as a color or image) our only choice (sort of writing our own handler) is to use Views PHP? Doesn't that create a security risk?
Comment #10
dawehnerWell, noone forces you to use views php.
You can always use the real views api and write your own handler.
But you are right the global: custom field will always strip css, because if it's not done, this is a security risk.