SHARE
TWEET

D7 - views-exposed-form--page_test_ct.tpl.php (TABLES!)

Sk8erPeter Sep 24th, 2012 208 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /**
  3.  * @file views-exposed-form--page_test_ct.tpl.php
  4.  *
  5.  * This template handles the layout of the views exposed filter form. Exposed filters will be output as a table.
  6.  * @see http://drupal.stackexchange.com/questions/44602/how-to-display-views-exposed-filters-fields-as-a-table
  7.  *
  8.  * Variables available:
  9.  * - $widgets: An array of exposed form widgets. Each widget contains:
  10.  * - $widget->label: The visible label to print. May be optional.
  11.  * - $widget->operator: The operator for the widget. May be optional.
  12.  * - $widget->widget: The widget itself.
  13.  * - $sort_by: The select box to sort the view using an exposed form.
  14.  * - $sort_order: The select box with the ASC, DESC options to define order. May be optional.
  15.  * - $items_per_page: The select box with the available items per page. May be optional.
  16.  * - $offset: A textfield to define the offset of the view. May be optional.
  17.  * - $reset_button: A button to reset the exposed filter applied. May be optional.
  18.  * - $button: The submit button for the form.
  19.  *
  20.  * @ingroup views_templates
  21.  */
  22. ?>
  23. <?php if (!empty($q)): ?>
  24.   <?php
  25.     // This ensures that, if clean URLs are off, the 'q' is added first so that
  26.     // it shows up first in the URL.
  27.     print $q;
  28.   ?>
  29. <?php endif; ?>
  30. <div class="views-exposed-form">
  31.   <div class="views-exposed-widgets clearfix">
  32.     <table class="views-exposed-widgets-table">
  33.       <tbody>
  34.       <?php foreach ($widgets as $id => $widget): ?>
  35.         <!-- move float:none style into a custom CSS file!! -->
  36.         <tr style="float:none;" id="<?php print $widget->id; ?>-wrapper" class="views-exposed-widget-table-row views-exposed-widget views-widget-<?php print $id; ?>">
  37.           <td class="views-exposed-widget-cell views-exposed-widget-label">
  38.           <?php if (!empty($widget->label)): ?>
  39.             <label for="<?php print $widget->id; ?>">
  40.               <?php print $widget->label; ?>
  41.             </label>
  42.           <?php endif; ?>
  43.           </td>
  44.          
  45.           <td class="views-exposed-widget-cell views-exposed-widget-operator">
  46.           <?php if (!empty($widget->operator)): ?>
  47.             <div class="views-operator">
  48.               <?php print $widget->operator; ?>
  49.             </div>
  50.           <?php endif; ?>
  51.           </td>
  52.          
  53.           <td class="views-exposed-widget-cell views-exposed-widget-widget">
  54.             <div class="views-widget">
  55.               <?php print $widget->widget; ?>
  56.             </div>
  57.           </td>
  58.          
  59.           <td class="views-exposed-widget-cell views-exposed-widget-description">
  60.           <?php if (!empty($widget->description)): ?>
  61.             <div class="description">
  62.               <?php print $widget->description; ?>
  63.             </div>
  64.           <?php endif; ?>
  65.           </td>
  66.          
  67.         </tr>
  68.       <?php endforeach; ?>
  69.       </tbody>
  70.     </table>
  71.    
  72.    
  73.     <?php if (!empty($sort_by)): ?>
  74.       <div class="views-exposed-widget views-widget-sort-by">
  75.         <?php print $sort_by; ?>
  76.       </div>
  77.       <div class="views-exposed-widget views-widget-sort-order">
  78.         <?php print $sort_order; ?>
  79.       </div>
  80.     <?php endif; ?>
  81.     <?php if (!empty($items_per_page)): ?>
  82.       <div class="views-exposed-widget views-widget-per-page">
  83.         <?php print $items_per_page; ?>
  84.       </div>
  85.     <?php endif; ?>
  86.     <?php if (!empty($offset)): ?>
  87.       <div class="views-exposed-widget views-widget-offset">
  88.         <?php print $offset; ?>
  89.       </div>
  90.     <?php endif; ?>
  91.     <div class="views-exposed-widget views-submit-button">
  92.       <?php print $button; ?>
  93.     </div>
  94.     <?php if (!empty($reset_button)): ?>
  95.       <div class="views-exposed-widget views-reset-button">
  96.         <?php print $reset_button; ?>
  97.       </div>
  98.     <?php endif; ?>
  99.   </div>
  100. </div>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top