Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-3.0
Component:
exposed filters
Priority:
Major
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
1 Apr 2013 at 22:01 UTC
Updated:
23 Jul 2013 at 15:00 UTC
I'm trying to print each exposed filter widget separately. Below is the foreach that prints all the widgets at the same time (via views-exposed-form.tpl.php). How would I go about printing them separately?
<?php foreach ($widgets as $id => $widget): ?>
<label for="<?php print $widget->id; ?>">
<?php print $widget->label; ?>
</label>
<?php print $widget->id; ?>
<?php endforeach; ?> Doing print_r function on $widgets shows the ff: array:
Array
(
[filter-tid] => stdClass Object
(
[widget] =>
Option 1
Option 2
Option 3
[operator] =>
[label] => label here
[id] => edit-id-here
)
[filter-tid_1] => stdClass Object
(
[widget] =>
Option 1
Option 2
Option 3
[operator] =>
[label] => label here
[id] => edit-id-here
)
....... and so on....
Comments
Comment #1
halloffame commentedI always enjoy talking to myself...
Comment #3
Renee S commentedHah, thanks for the snippet -- also enjoyed the commentary ;)
Comment #3.0
Renee S commentedtypo