You are here

function hook_facetapi_realm_info in Facet API 7

Same name and namespace in other branches
  1. 6.3 facetapi.api.php \hook_facetapi_realm_info()
  2. 6 facetapi.api.inc \hook_facetapi_realm_info()
  3. 7.2 facetapi.api.php \hook_facetapi_realm_info()

Define all realms provided by the module.

A realm is a group of facets that are rendered in a similar fashion. For example, the "block" realm displays each facet in a separate block, whereas the "fieldset" realm displays facets as form elements in a fieldset under the search form.

Return value

array An associative array keyed by unique name of the realm. Each realm is an associative array containing:

  • label: The human readable name of the realm displayed in the admin UI.
  • description: The description of the realm displayed in the admin UI.
  • element type: The type of element facets are rendered as, such as "links" or "form elements".
  • default widget: The default widget plugin id for facets.
  • settings callback: (optional) A callback that alters the realm settings form, defaults to FALSE meaning no callback is defined.
  • sortable: (optional) Whether the facets can be sorted via the admin UI, defaults to TRUE.
  • weight: (optional) The weight of the realm's menu item in comparison to the others, defaults to 0.
2 functions implement hook_facetapi_realm_info()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

facetapi_facetapi_realm_info in ./facetapi.facetapi.inc
Implements hook_facetapi_realm_info().
facetapi_test_facetapi_realm_info in tests/facetapi_test.facetapi.inc
Implements hook_facetapi_realm_info().
1 invocation of hook_facetapi_realm_info()
facetapi_get_realm_info in ./facetapi.module
Returns all defined realm definitions.

File

./facetapi.api.php, line 96
Hooks provided by the Facet API module.

Code

function hook_facetapi_realm_info() {
  return array(
    'block' => array(
      'label' => t('Blocks'),
      'sortable' => FALSE,
      'weight' => -10,
      'default widget' => 'facetapi_links',
      'element type' => 'links',
      'settings callback' => 'facetapi_block_realm_settings',
      'description' => t('The <em>Blocks</em> realm displays each facet in a separate <a href="@block-page">block</a>. Users are able to refine their searches in a drill-down fashion.', array(
        '@block-page' => url('admin/structure/block', array(
          'query' => array(
            'destination' => current_path(),
          ),
        )),
      )),
    ),
  );
}