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.
We use separate HTML elements to define ordered lists and unordered lists. Ordered lists and unordered lists are semantically different things.
During discussions about Twig conversion in the Autumn of 2012, we decided a core principle was "Organization should be driven by meaning and semantics over technical convenience." This represents that change.
Related: #54898: Add a description-list.html.twig template (ex. definition list)
Comment | File | Size | Author |
---|---|---|---|
#5 | split-theme-item-list-1904582-5.patch | 43.23 KB | msmithcti |
#3 | split-theme-item-list-1904582-3.patch | 41.13 KB | msmithcti |
#2 | split-theme-item-list-1904582-2.patch | 41.15 KB | msmithcti |
Comments
Comment #1
c4rl CreditAttribution: c4rl commentedTagging
Comment #2
msmithcti CreditAttribution: msmithcti commentedOnly just realised you were assigned to this c4rl. Here's the patch I started anyway to get the ball rolling. The theme function tests are still failing so needs some more work there.
Comment #3
msmithcti CreditAttribution: msmithcti commentedOK, the theme function tests are now passing for theme_ordered_list() and theme_unordered_list().
Comment #5
msmithcti CreditAttribution: msmithcti commentedMissed a couple of usages of
item_list__*
, the tests should now pass.Comment #6
msmithcti CreditAttribution: msmithcti commentedComment #7
thedavidmeister CreditAttribution: thedavidmeister commentedPatch in #5 creates new theme functions. In light of #1757550: [Meta] Convert core theme functions to Twig templates I don't think we should be creating any new theme functions at this point - everything in core should be a Twig template.
For preprocess functions "Preprocesses variables for " should now be "Prepares variables for " - see #1913208: [policy] Standardize template preprocess function documentation.
Would we be completely against leaving theme('item_list') in place and turning it into a wrapper around the ordered and unordered theme functions?
I feel it would be considerate to "deprecate" item list at first rather than killing it off as a *lot* of contrib/custom code will be it.
I'm setting this to "needs work" but really it's pretty much postponed until #1939062: Convert theme_item_list() to Twig lands.
Comment #8
joelpittetFYI there is a
<fields>
in tests that held that one up a bit because it was trying to be explicit about OL or UL and nothing else. I'm not sure that fields tag should be, but there are tests for it as it stands. Also, there is a bit of a balance to strike here were we are trying really hard not to create a theme function for every HTML tag. I'm currently on the let's not do this split and create another template for OLs and ULs and leave itemlist as it is. I'd much rather get item_list into a nice recursive twig macro instead of the extra preprocess work.Comment #9
star-szrComment #10
mgiffordUnassigning stale issue. Hopefully someone else will pursue this.