You are here

function hook_apachesolr_search_page_alter in Apache Solr Search 7

Same name and namespace in other branches
  1. 8 apachesolr.api.php \hook_apachesolr_search_page_alter()
  2. 6.3 apachesolr.api.php \hook_apachesolr_search_page_alter()

Modify the build array for any search output build by Apache Solr This includes core and custom pages and makes it very easy to modify both of them at once

Parameters

array $build:

array $search_page:

1 invocation of hook_apachesolr_search_page_alter()
apachesolr_search_search_page_custom in ./apachesolr_search.module
Mimics apachesolr_search_search_page() but is used for custom search pages We prefer to keep them separate so we are not dependent from core search when someone tries to disable the core search

File

./apachesolr.api.php, line 378
Exposed Hooks in 7.x:

Code

function hook_apachesolr_search_page_alter(array &$build, array $search_page) {

  // Adds a text to the top of the page
  $info = array(
    '#markup' => t('Add information to every search page'),
  );
  array_unshift($build, $info);
}