function template_preprocess_item_list

Same name and namespace in other branches
  1. 10 core/includes/theme.inc \template_preprocess_item_list()
  2. 9 core/includes/theme.inc \template_preprocess_item_list()
  3. 8.9.x core/includes/theme.inc \template_preprocess_item_list()

Prepares variables for item list templates.

Default template: item-list.html.twig.

Parameters

array $variables: An associative array containing:

  • items: An array of items to be displayed in the list. Each item can be either a string or a render array. If #type, #theme, or #markup properties are not specified for child render arrays, they will be inherited from the parent list, allowing callers to specify larger nested lists without having to explicitly specify and repeat the render properties for all nested child lists.
  • title: A title to be prepended to the list.
  • list_type: The type of list to return (e.g. "ul", "ol").
  • wrapper_attributes: HTML attributes to be applied to the list wrapper.

Deprecated

in drupal:11.3.0 and is removed from drupal:12.0.0. Initial template_preprocess functions are registered directly in hook_theme().

See also

https://www.drupal.org/node/3504125

File

core/includes/theme.inc, line 620

Code

function template_preprocess_item_list(&$variables) : void {
  @trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.3.0 and is removed from drupal:12.0.0. Initial template_preprocess functions are registered directly in hook_theme(). See https://www.drupal.org/node/3504125', E_USER_DEPRECATED);
  \Drupal::service(ThemePreprocess::class)->preprocessItemList($variables);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.