materio-search-api-results.tpl.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 and themes may implement their own search type and theme
  11. * function completely bypassing this template.
  12. *
  13. * Available variables:
  14. * - $result_count: Number of results.
  15. * - $spellcheck: Possible spelling suggestions from Search spellcheck module.
  16. * - $search_results: All results rendered as list items in a single HTML string.
  17. * - $items: All results as it is rendered through search-result.tpl.php.
  18. * - $search_performance: The number of results and how long the query took.
  19. * - $sec: The number of seconds it took to run the query.
  20. * - $pager: Row of control buttons for navigating between pages of results.
  21. * - $index:
  22. * - $keys: The keywords of the executed search.
  23. * - $page_machine_name: Machine name of the current Search API Page.
  24. *
  25. * View Mode is set in the Search page settings. If you select
  26. * "Themed as search results", then the child template will be used for
  27. * theming the individual result. Any other view mode will bypass the
  28. * child template.
  29. *
  30. * @see template_preprocess_search_api_page_results()
  31. */
  32. ?>
  33. <div class="materiobase-results <?php print ' view-mode-' . $variables['view_mode'];?>">
  34. <?php if(!$perfascard): ?>
  35. <p class="search-performance"><?php print render($search_performance); ?></P>
  36. <?php endif; ?>
  37. <div class="search-results">
  38. <?php if($perfascard): ?>
  39. <article class="search-performance <?php print ' view-mode-' . $variables['view_mode'];?>">
  40. <div class="inner">
  41. <p><?php print render($search_performance); ?></P>
  42. </div>
  43. </article>
  44. <?php endif; ?>
  45. <?php
  46. // TODO: use cache system to gain in speed, view http://drupal.org/node/930760
  47. ?>
  48. <?php if ($result_count) : ?>
  49. <?php print render(entity_view('node', $items, $variables['view_mode'])); ?>
  50. <?php endif; ?>
  51. </div>
  52. <?php print $pager; ?>
  53. </div>