There is a small todo in views_plugin_display_system::execute, because some css is added.
What about using a preprocess_views_view and check for the used display.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | 1603828-12.patch | 704 bytes | damiankloip |
| #10 | 1603828-10.patch | 1.1 KB | damiankloip |
| #9 | 1603828-9.patch | 1.1 KB | damiankloip |
| #1 | 1603828-css-todo.patch | 1.13 KB | dawehner |
Comments
Comment #1
dawehnerThis works fine for me
Comment #3
sunApparently, the testbot disagrees ;)
Does Views provide no way to do this from within the display handler? Ideally, I'd think that this should be part of the render array being generated and also use #attached, so other/custom modules and themes can adjust it when necessary.
Comment #4
dawehnerWhich render array ... views still builds a lot of with strings, so for example display::render() should return the rendered string.
There are several reasons for that. First merlinofchaos has a strong opinion against it, and second this would have required at least some breaking of template files from d6 to d7. Funny enough a lot of people complained, quite some people tried to convert it and all of them failed.
A workaround seems to me to add something to the view object, and support it in views itself, though this is still inconsistent.
Comment #5
damiankloip commentedIf everyone agrees, I think that at best this issue should be marked as postponed? This would need a patch to go into views for another implementation that is better than the current one.
Comment #6
sunOur current code seems to fail to load the CSS for the preview in the Views admin UI, so if there is any approach that makes that work, then I think we should go for it.
Comment #7
damiankloip commentedsun, leave it with me. I will see what we can do and report back :)
Comment #8
sunLet's clarify this issue a bit.
Comment #9
damiankloip commentedok, if we are definitely going to pursue this one. The only other way I can think of doing this is in this patch. If we override the preview() method for the display plugin we can add our css inline.
Comment #10
damiankloip commentedBut without the two ; in the render function :)
Comment #11
sunugh. ;)
If there's really no better support in Views for adding JS/CSS to the live preview, then I'd say let's rather ignore the problem... :-/
The first hunk (as well as removing the @todo) would make sense though.
Comment #12
damiankloip commentedI know :/ It's certainly not ideal (or even close). I just thought I would propose the only option I could think of and see what the consensus was. That's why I didn't voice an opinion about it in #9. This approach isn't that nice, you're right ;)
I am happy to close this too as it's not a deal breaker imo.
Shall we just go with this in that case?
Comment #13
sunComment #14
damiankloip commentedCommitted to 7.x-1.x