You are here

function sarnia_search_api_facetapi_keys_alter in Sarnia 7

Implements hook_search_api_facetapi_keys_alter().

search_api_facetapi uses any query keys as the breadcrumb title. For Sarnia queries, this ends up being a list of entity ids; the original page title is more appropriate.

File

./sarnia.module, line 1203

Code

function sarnia_search_api_facetapi_keys_alter(&$keys, $query) {

  // Only change keys for Sarnia indexes.
  if ($query instanceof SearchApiQuery && ($index = $query
    ->getIndex()) && sarnia_entity_type_load_by_index($index->machine_name)) {
    $keys = drupal_get_title();
  }
}