Active
Project:
Drupal core
Version:
main
Component:
views.module
Priority:
Major
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
10 Sep 2015 at 21:16 UTC
Updated:
29 Nov 2025 at 07:48 UTC
Jump to comment: Most recent
Follow up from #2492839: Views replacement token bc layer allows for Twig template injection via arguments. The use of renderPlain() instead of executeInRenderContext() could limit use of the Views token system in the future. Currently there is no way to attach assets to a token, but perhaps that would make sense someday? Or perhaps render contexts will grow to include things that do make sense in a Views token.
For now, this is a landing page for an @todo in the code.
Comments
Comment #2
fabianx commentedThe primary main limitation is not being able to do:
{{ attach_library('core/foo') }}
in the inline template. The secondary just comes into play if there is placeholders that are not strings.
Comment #16
smustgrave commentedThank you for creating this issue to improve Drupal.
We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.
Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.
Thanks!
Comment #17
mxh commentedStumbled into this, experiencing the exact problem as described in #2.
I'm wondering why all that stuff is being executed in an isolated way. This doesn't allow to add relevant cacheability metadata, and attaching more assets when needed is also not possible. Yes it's kind of an edge case, but it's possible to call attach_library without any error so either it should be supported in there or an error should be thrown when attempting to do such thing.
Comment #18
smustgrave commentedComment #19
quietone commented