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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. <?php //dsm($index, 'index'); ?>
  34. <?php //dsm($search_performance, 'search_performance'); ?>
  35. <?php //dsm($result_count, 'result_count'); ?>
  36. <?php //if (!empty($result_count)) : ?>
  37. <div class="materiobase-results <?php print ' view-mode-' . $variables['view_mode'];?>">
  38. <?php //if ($result_count) : ?>
  39. <?php if(!$perfascard): ?>
  40. <p class="search-performance"><?php print render($search_performance); ?></P>
  41. <?php endif; ?>
  42. <?php //print render($spellcheck); ?>
  43. <div class="search-results">
  44. <?php if($perfascard): ?>
  45. <article class="search-performance <?php print ' view-mode-' . $variables['view_mode'];?>">
  46. <div class="inner">
  47. <p><?php print render($search_performance); ?></P>
  48. </div>
  49. </article>
  50. <?php endif; ?>
  51. <?php //dsm($items, '$items'); ?>
  52. <?php
  53. // TODO: use cache system to gain in speed, view http://drupal.org/node/930760
  54. ?>
  55. <?php if ($result_count) : ?>
  56. <?php print render(entity_view($index->item_type, $items, $variables['view_mode'])); ?>
  57. <?php endif; ?>
  58. </div>
  59. <?php print $pager; ?>
  60. <?php //else : ?>
  61. <!-- <p class="search-noresults"><?php print t('Your search yielded no results.');?></p> -->
  62. <?php //endif; ?>
  63. </div>
  64. <?php //endif; ?>