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)

Files: 
CommentFileSizeAuthor
#5 split-theme-item-list-1904582-5.patch43.23 KBsplatio
PASSED: [[SimpleTest]]: [MySQL] 53,079 pass(es). View
#3 split-theme-item-list-1904582-3.patch41.13 KBsplatio
FAILED: [[SimpleTest]]: [MySQL] 53,183 pass(es), 24 fail(s), and 0 exception(s). View
#2 split-theme-item-list-1904582-2.patch41.15 KBsplatio
FAILED: [[SimpleTest]]: [MySQL] 52,901 pass(es), 88 fail(s), and 8 exception(s). View

Comments

c4rl’s picture

Issue tags: +Twig

Tagging

splatio’s picture

Status: Active » Needs work
FileSize
41.15 KB
FAILED: [[SimpleTest]]: [MySQL] 52,901 pass(es), 88 fail(s), and 8 exception(s). View

Only 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.

splatio’s picture

Status: Needs work » Needs review
FileSize
41.13 KB
FAILED: [[SimpleTest]]: [MySQL] 53,183 pass(es), 24 fail(s), and 0 exception(s). View

OK, the theme function tests are now passing for theme_ordered_list() and theme_unordered_list().

Status: Needs review » Needs work

The last submitted patch, split-theme-item-list-1904582-3.patch, failed testing.

splatio’s picture

FileSize
43.23 KB
PASSED: [[SimpleTest]]: [MySQL] 53,079 pass(es). View

Missed a couple of usages of item_list__*, the tests should now pass.

splatio’s picture

Status: Needs work » Needs review
thedavidmeister’s picture

Status: Needs review » Needs work

Patch 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.

joelpittet’s picture

FYI 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.

Cottser’s picture

mgifford’s picture

Assigned: c4rl » Unassigned

Unassigning stale issue. Hopefully someone else will pursue this.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.