Skip navigation
Help

search-results.tpl.php

  1. drupal
    1. 6 drupal/modules/search/search-results.tpl.php
    2. 7 drupal/modules/search/search-results.tpl.php

Default theme implementation for displaying search results.

This template collects each invocation of theme_search_result(). This and the child template are dependent to one another sharing the markup for definition lists.

Note that modules may implement their own search type and theme function completely bypassing this template.

Available variables:

  • $search_results: All results as it is rendered through search-result.tpl.php
  • $module: The machine-readable name of the module (tab) being searched, such as "node" or "user".

See also

template_preprocess_search_results()

File

drupal/modules/search/search-results.tpl.php
View source
  1. <?php
  2. /**
  3. * @file
  4. * Default theme implementation for displaying search results.
  5. *
  6. * This template collects each invocation of theme_search_result(). This and
  7. * the child template are dependent to one another sharing the markup for
  8. * definition lists.
  9. *
  10. * Note that modules may implement their own search type and theme function
  11. * completely bypassing this template.
  12. *
  13. * Available variables:
  14. * - $search_results: All results as it is rendered through
  15. * search-result.tpl.php
  16. * - $module: The machine-readable name of the module (tab) being searched, such
  17. * as "node" or "user".
  18. *
  19. *
  20. * @see template_preprocess_search_results()
  21. */
  22. ?>
  23. <?php if ($search_results) : ?>
  24. <h2><?php print t('Search results');?></h2>
  25. <ol class="search-results <?php print $module; ?>-results">
  26. <?php print $search_results; ?>
  27. </ol>
  28. <?php print $pager; ?>
  29. <?php else : ?>
  30. <h2><?php print t('Your search yielded no results');?></h2>
  31. <?php print search_help('search#noresults', drupal_help_arg()); ?>
  32. <?php endif; ?>