You are here

function theme_ds_search_page in Display Suite 7.2

Same name and namespace in other branches
  1. 7 modules/ds_search/ds_search.module \theme_ds_search_page()

Search page theming.

1 theme call to theme_ds_search_page()
ds_search_search_page in modules/ds_search/ds_search.module
Implements hook_search_page().

File

modules/ds_search/ds_search.module, line 56
Display Suite search.

Code

function theme_ds_search_page($build) {

  // fix for Drupal 7.33+
  if (isset($build['theme_hook_original'])) {
    unset($build['theme_hook_original']);
  }

  // Check on empty search results.
  if (empty($build['search_results'])) {

    // Alter the title and extra variables.
    if (!empty($build['search_title'])) {
      $build['search_title']['#markup'] = '<h2>' . t('Your search yielded no results') . '</h2>';
      unset($build['search_extra']);
    }
    $build['search_empty'] = array(
      '#markup' => search_help('search#noresults', drupal_help_arg()),
    );
  }
  $build['search_results']['#sorted'] = TRUE;
  return $build;
}