You are here

function hook_facetapi_force_delta_mapping in Facet API 7.2

Same name and namespace in other branches
  1. 6.3 facetapi.api.php \hook_facetapi_force_delta_mapping()
  2. 7 facetapi.api.php \hook_facetapi_force_delta_mapping()

Forces delta mapping of a facet block.

This obscure hook is useful for cases where facets are disabled, but their block positioning needs to be set anyways. If a facet is enabled via the facetapi_set_facet_enabled() API function, its block needs to be enabled and assigned to a region despite the facet not being enabled in the Facet API interface, which would normally prevent the block from being listed.

Return value

array An associative array keyed by searcher. Each sub array is an associative array keyed by realm name to facet names whose delta mappings are forced.

1 invocation of hook_facetapi_force_delta_mapping()
facetapi_get_delta_map_queue in ./facetapi.block.inc
Returns facets that are enabled or whose delta mapping is forced.

File

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

Code

function hook_facetapi_force_delta_mapping() {
  return array(
    // The machine-readable name of the searcher.
    'my_searcher' => array(
      // The realm we are mapping, usually block.
      'block' => array(
        // Machine readable names of facets whose mapping are being forced.
        // Regardless of whether they are enabled via the Facet API interface,
        // their blocks will be available to enable and position via
        // admin/structure/block.
        'facet_one',
        'facet_two',
      ),
    ),
  );
}