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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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($items, 'items'); ?>
  35. <?php if (!empty($result_count)) : ?>
  36. <div class="materiobase-results <?php print ' view-mode-' . $variables['view_mode'];?>">
  37. <?php if ($result_count) : ?>
  38. <?php //print render($search_performance); ?>
  39. <?php //print render($spellcheck); ?>
  40. <div class="search-results">
  41. <?php $eview = entity_view($index->item_type, $items, $variables['view_mode']); ?>
  42. <?php //dsm($eview, 'eview'); ?>
  43. <?php print render($eview); ?>
  44. <?php
  45. // foreach ($eview[$index->item_type] as $entity){
  46. // $renders[] = render($entity);
  47. // }
  48. // dsm($renders, 'renders');
  49. // print implode('<!-- whitespace -->', $renders);
  50. ?>
  51. </div>
  52. <?php print $pager; ?>
  53. <?php else : ?>
  54. <h2><?php print t('Your search yielded no results.');?></h2>
  55. <?php endif; ?>
  56. </div>
  57. <?php endif; ?>