home | career | drupal | java | mac | mysql | perl | php | scala | uml | unix

Drupal example source code file (views-exposed-form.tpl.php)

This example Drupal source code file (views-exposed-form.tpl.php) is included in the DevDaily.com "Drupal Source Code Warehouse" project. The intent of this project is to help you "Learn Drupal by Example".

PHP - Drupal tags/keywords

class, clear-block, div, empty, endif, foreach, label, php, views-exposed-form, views-exposed-widget, views-operator, widgets

The views-exposed-form.tpl.php Drupal example source code

// $Id: views-exposed-form.tpl.php,v 2009/11/18 20:37:58 merlinofchaos Exp $
 * @file 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.
 * @ingroup views_templates
<?php if (!empty($q)): ?>
    // This ensures that, if clean URLs are off, the 'q' is added first so that
    // it shows up first in the URL.
    print $q;
<?php endif; ?>
<div class="views-exposed-form">
  <div class="views-exposed-widgets clear-block">
    <?php foreach($widgets as $id => $widget): ?>
      <div class="views-exposed-widget">
        <?php if (!empty($widget->label)): ?>
          <label for="<?php print $widget->id; ?>">
            <?php print $widget->label; ?>
        <?php endif; ?>
        <?php if (!empty($widget->operator)): ?>
          <div class="views-operator">
            <?php print $widget->operator; ?>
        <?php endif; ?>
        <div class="views-widget">
          <?php print $widget->widget; ?>
    <?php endforeach; ?>
    <div class="views-exposed-widget">
      <?php print $button ?>

Other Drupal examples (source code examples)

Here is a short list of links related to this Drupal views-exposed-form.tpl.php source code file:

new blog posts

"Drupal" is a registered trademark of Dries Buytaert.

my drupal tutorials and examples  

Copyright 1998-2016 Alvin Alexander, alvinalexander.com
All Rights Reserved.

Beginning in 2016, a portion of the proceeds from pages under the '/drupal-code-examples/' URI will be donated to charity.