Follow-up to #2152261: Clean up for tablesort-indicator.html.twig
Problem/Motivation
Fix the urls created for the image assets.
url() will produce /fr-ca/ or /drupal/ prefixed urls, I should have used file_create_url() for this but that doesn't exist in twig yet.
I've got a proposal started for that over at #2168231: Twig Functions needed in templates.
In the mean time I'd like to revert part of this so that it's working.
And the best solution for this template would be #2189729: Factor out tablesort-indicator.html.twig IMO.
Proposed resolution
Make the core template use the same pattern of building the asset file url in preprocess and pass it to the template.
Remaining tasks
User interface changes
API changes
Comment | File | Size | Author |
---|---|---|---|
#2 | interdiff.txt | 2.26 KB | joelpittet |
#2 | 2310311-fix-tablesort-indicator-urls-2.patch | 2.12 KB | joelpittet |
#1 | 2310311-1-sort-indicator-url-fix.patch | 2.06 KB | joelpittet |
Comments
Comment #1
joelpittetHere's the patch
Comment #2
joelpittetSome doc fixes from @Cottser in #2073811: Add a url generator twig extension
Comment #3
star-szrLooks great, thanks @joelpittet!
Comment #4
dawehnerSeriously what is the point of this issue ... doesn't this just cause additional reroll work?
I would argue that this patch should add a file_create_url() twig extension instead.
Comment #5
joelpittetIt's to fix my mistake and hopefully be a warning to others who use url() instead of file_create_url().
Comment #6
dawehnerYeah sure, let's get this in, unless the other one is faster.
Comment #7
joelpittetDibs on re-roll for the url generator issue if this gets in first;)
Comment #8
alexpott#2073811: Add a url generator twig extension is in. Shall we make this issue about adding a file_create_url() twig extension instead?
Comment #9
joelpittetDebating using this as a file_create_url() because we have an issue discussing it over #2168231: Twig Functions needed in templates so for now closing it as a duplicate and may re-open and possibly consider calling that one a [META]
Thank you @alexpott
Comment #10
star-szrI think we're covered by #2308187: Provide a twig extension for file_create_url so yes this can be closed as a dupe.