Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Follow-up from #1939090: Convert theme_tablesort_indicator() to Twig.
- Remove spaceless
- Remove the preprocess function and move condition to template.
Comment | File | Size | Author |
---|---|---|---|
#19 | clean_up_for-2152261-19.patch | 2.06 KB | joelpittet |
#17 | 2152261-17.patch | 1.84 KB | joelpittet |
#11 | 2152261-11-tablesort-cleanup.patch | 2.2 KB | joelpittet |
Comments
Comment #1
joelpittetThis should do the trick, also makes it easier for themers to replace with icon font or svg or whatever they wish.
Comment #3
joelpittetpasses, locally.... Retesting.
Comment #4
joelpittet1: 2152261-1-tablesort-cleanup.patch queued for re-testing.
Comment #6
star-szr1: 2152261-1-tablesort-cleanup.patch queued for re-testing.
Comment #7
star-szrThis looks pretty great to me!
There are two spaces between the closing quote and the
/>
, should just be one.Comment #8
joelpittetThanks @Cottser, space removed.
Comment #9
star-szrThanks @joelpittet! Reviewing this again, a couple things doc-wise to fix up:
1. We should remove this line from tablesort-indicator.html.twig:
@see template_preprocess_tablesort_indicator()
2. We're no longer providing image or uri to the template so those variables can be removed from the template docblock.
And I want to mention that with rdf.module enabled we lose
typeof="foaf:Image"
but that seems fine to me in this context. I'm liking that seven could now just override this template instead of writing a big preprocess for its tweaks.Before:
After:
Comment #10
star-szrAlso I think this is followup for #1939090: Convert theme_tablesort_indicator() to Twig if I'm not mistaken.
Comment #11
joelpittetRemoved the @see and image and uri from the variables. Good point and yeah the RDF indication on that is doubtfully necessary, though maybe it would be good to have @scor or @linclark weigh in?
Comment #12
joelpittetWhoops:D
Comment #13
scor CreditAttribution: scor commented@Cottser: I'd be fine with losing foaf:Image -
let me know if go that route and I can create a follow up issue to reflect that in the rest of the RDF implementation.EDIT: I misread the issue. we're no longer calling theme_image() and instead hard coding the img element in Twig. It's perfectly fine to lose the foaf:Image, please go ahead (no follow up of any kind required).
Comment #14
star-szrThanks @scor! I like this change a lot, RTBC from me.
Comment #15
Dries CreditAttribution: Dries commentedNice clean-up. Committed to 8.x. Thanks.
Comment #17
joelpittetDang this looked better than it was. 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.
Comment #19
joelpittetNot sure why that didn't apply but gives me a chance to fix up the docblock to match the seven theme's template.
Comment #20
joelpittetSetting back to fixed, moved to a follow-up #2310311: Fix for tablesort-indicator.html.twig image urls ... follow the bouncing ball.