views-exposed-form.tpl.php

  1. 3.x theme/views-exposed-form.tpl.php
  2. 2.x theme/views-exposed-form.tpl.php

views-exposed-form.tpl.php

This template handles the layout of the views exposed filter form.

Variables available:

  • $widgets: An array of exposed form widgets. Each widget contains:
  • $widget->label: The visible label to print. May be optional.
  • $widget->operator: The operator for the widget. May be optional.
  • $widget->widget: The widget itself.
  • $button: The submit button for the form.

File

theme/views-exposed-form.tpl.php
View source
  1. <?php
  2. /**
  3. * @file views-exposed-form.tpl.php
  4. *
  5. * This template handles the layout of the views exposed filter form.
  6. *
  7. * Variables available:
  8. * - $widgets: An array of exposed form widgets. Each widget contains:
  9. * - $widget->label: The visible label to print. May be optional.
  10. * - $widget->operator: The operator for the widget. May be optional.
  11. * - $widget->widget: The widget itself.
  12. * - $button: The submit button for the form.
  13. *
  14. * @ingroup views_templates
  15. */
  16. ?>
  17. <?php if (!empty($q)): ?>
  18. <?php
  19. // This ensures that, if clean URLs are off, the 'q' is added first so that
  20. // it shows up first in the URL.
  21. print $q;
  22. ?>
  23. <?php endif; ?>
  24. <div class="views-exposed-form">
  25. <div class="views-exposed-widgets clear-block">
  26. <?php foreach ($widgets as $id => $widget): ?>
  27. <div class="views-exposed-widget views-widget-<?php print $id; ?>">
  28. <?php if (!empty($widget->label)): ?>
  29. <label for="<?php print $widget->id; ?>">
  30. <?php print $widget->label; ?>
  31. </label>
  32. <?php endif; ?>
  33. <?php if (!empty($widget->operator)): ?>
  34. <div class="views-operator">
  35. <?php print $widget->operator; ?>
  36. </div>
  37. <?php endif; ?>
  38. <div class="views-widget">
  39. <?php print $widget->widget; ?>
  40. </div>
  41. </div>
  42. <?php endforeach; ?>
  43. <div class="views-exposed-widget views-submit-button">
  44. <?php print $button; ?>
  45. </div>
  46. </div>
  47. </div>

Related topics