function facets_preprocess_facets_item_list in Facets 8
Prepares variables for facets item list templates.
Default template: facets-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.
See also
https://www.drupal.org/node/1842756
File
- ./
facets.module, line 205 - Contains facets.module.
Code
function facets_preprocess_facets_item_list(array &$variables) {
if ($variables['facet'] !== NULL && $variables['facet']
->get('show_title') === TRUE) {
$variables['title'] = $variables['facet']
->label();
}
template_preprocess_item_list($variables);
}