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.
Problem/Motivation
Several portions of Drupal markup such as Local tasks, Links, and Breadcrumbs either create their own lists or produces some other markup that *should* be ordered or unordered lists.
Proposed resolution
Implement theme('item_list')
wherever possible, including:
theme_linkstheme_task_listtheme_menu_treetheme_menu_linktheme_menu_local_taskstheme_menu_local_tasktheme_menu_local_action- views_view_summary.html.twig
breadcrumbpager
Remaining tasks
- #311011: Replace links.html.twig with item-list--links.html.twig
- #1777332: Replace theme_menu_link() and menu-tree.html.twig with a single Twig template
- #2032695: Use item-list.html.twig instead of views_view_summary.html.twig
Related tasks
#1751194: Introduce hook_theme_suggestions[_HOOK]() and hook_theme_suggestions[_HOOK]_alter()
#1598886: Clean up pager theme functions
#1222254: Remove theme_task_list() and call theme('item_list__tasks') instead.
User interface changes
None.
API changes
TBD
Comments
Comment #1
steveoliver CreditAttribution: steveoliver commentedTagging.
Comment #2
sunMarking as duplicate of:
#1804614: [meta] Consolidate theme functions and properly use theme suggestions in core
#891112: Replace theme_item_list()'s 'data' items with render elements
Comment #2.0
jenlamptonupdate summary
Comment #2.1
jenlamptonmore links
Comment #2.2
jenlamptonbreadcrumb
Comment #2.3
jenlamptonlinks
Comment #2.4
jenlamptonadd menu stuff
Comment #3
jenlamptonI'm going to re-open this issue and use it as a meta issue where I can track all the item-list-like theme functions in core that need to be consolidated, and have theme_hook_suggestions added.
Comment #3.0
jenlamptonupdate
Comment #3.1
jenlamptonadd master issue
Comment #3.2
jenlamptonmore
Comment #3.3
jenlamptonless
Comment #3.4
jenlamptonup
Comment #3.5
jenlamptonreorganize
Comment #3.6
jenlamptonreorg
Comment #3.7
jenlamptonviews view summary
Comment #4
jenlamptontagging
Comment #4.0
jenlamptonactual funcs
Comment #4.1
jenlamptonnow with links
Comment #5
mitokens CreditAttribution: mitokens as a volunteer commentedComment #6
mitokens CreditAttribution: mitokens as a volunteer commentedComment #7
akalata CreditAttribution: akalata commentedUpdates, many theme functions no longer exist in core.