function hook_facetapi_widgets in Facet API 7
Same name and namespace in other branches
- 6.3 facetapi.api.php \hook_facetapi_widgets()
- 7.2 facetapi.api.php \hook_facetapi_widgets()
Define all widget plugins provided by the module.
See the FacetapiWidget docblock for more information on what widget plugins do and what their responsibilities are.
Return value
array An associative array keyed by unique name of the widget. Each widget is an associative array keyed by "handler" containing:
- label: The human readable name of the plugin displayed in the admin UI.
- class: The name of the plugin class.
- query types: An array of query-types that this widget is compatible with.
- requirements: An array of requirements that must pass in order for this widget to be displayed. Requirements are associative arrays keyed by function to requirement options. The value defaults to a requirement that the "element type" realm property is equal to "links".
See also
2 functions implement hook_facetapi_widgets()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- facetapi_facetapi_widgets in ./
facetapi.facetapi.inc - Implements hook_facetapi_widgets().
- facetapi_test_facetapi_widgets in tests/
facetapi_test.facetapi.inc - Implements hook_facetapi_widgets().
File
- ./
facetapi.api.php, line 485 - Hooks provided by the Facet API module.
Code
function hook_facetapi_widgets() {
return array(
'facetapi_links' => array(
'handler' => array(
'label' => t('Links'),
'class' => 'FacetapiWidgetLinks',
'query types' => array(
'term',
'date',
),
'requirements' => array(
'facetapi_requirement_realm_property' => array(
'element type' => 'links',
),
),
),
),
);
}