You are here

protected function WidgetPluginBase::getFacetItemListThemeHook in Facets 8

Provides a full array of possible theme functions to try for a given hook.

This allows the following template suggestions:

  • facets-item-list--WIDGET_TYPE--FACET_ID
  • facets-item-list--WIDGET_TYPE
  • facets-item-list.

Parameters

\Drupal\facets\FacetInterface $facet: The facet whose output is being generated.

Return value

string A theme hook name with suggestions, suitable for the #theme property.

2 calls to WidgetPluginBase::getFacetItemListThemeHook()
WidgetPluginBase::build in src/Widget/WidgetPluginBase.php
Builds the facet widget for rendering.
WidgetPluginBase::buildListItems in src/Widget/WidgetPluginBase.php
Builds a renderable array of result items.

File

src/Widget/WidgetPluginBase.php, line 107

Class

WidgetPluginBase
A base class for widgets that implements most of the boilerplate.

Namespace

Drupal\facets\Widget

Code

protected function getFacetItemListThemeHook(FacetInterface $facet) {
  $type = $facet
    ->getWidget()['type'] ?? 'std';
  return 'facets_item_list__' . $type . '__' . $facet
    ->id();
}