class FacetapiFilterCurrentDepth in Facet API 7
Same name and namespace in other branches
- 6.3 plugins/facetapi/filter.inc \FacetapiFilterCurrentDepth
- 7.2 plugins/facetapi/filter.inc \FacetapiFilterCurrentDepth
Plugin that filters all items not in current hierarchy.
For hierarchical facets such as taxonomy, it might be advantageous to only display the current level of the hierarchy to implement the progressive disclosure pattern inside of the facet. For example, if your taxonomy tree is Make -> Model -> Year for cars, you might want to only display one level at a time. After selecting a make, users should only be presented with the available models.
Hierarchy
- class \FacetapiFilter
- class \FacetapiFilterCurrentDepth
Expanded class hierarchy of FacetapiFilterCurrentDepth
1 string reference to 'FacetapiFilterCurrentDepth'
- facetapi_facetapi_filters in ./
facetapi.facetapi.inc - Implements hook_facetapi_filters().
File
- plugins/
facetapi/ filter.inc, line 141 - Base filter class and core implementations.
View source
class FacetapiFilterCurrentDepth extends FacetapiFilter {
/**
* Implements FacetapiFilter::execute().
*/
public function execute(array $build) {
foreach ($build as $item) {
if ($item['#active'] && !empty($item['#item_children'])) {
return $this
->execute($item['#item_children']);
}
}
return $build;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FacetapiFilter:: |
protected | property | The adapter associated with facet being filtered. | |
FacetapiFilter:: |
protected | property | The machine name of the plugin associated with this instance. | |
FacetapiFilter:: |
protected | property | The facet settings. | |
FacetapiFilter:: |
public | function | Provides default values for the plugin settings. | |
FacetapiFilter:: |
public | function | Allows the plugin to add settings to the dependency form. | |
FacetapiFilter:: |
public | function | Constructs a FacetapiFilter object. | |
FacetapiFilterCurrentDepth:: |
public | function |
Implements FacetapiFilter::execute(). Overrides FacetapiFilter:: |