I'm trying to theme the views exposed filters. I use twitter bootstrap and I want to put the label into a placeholder attributes to have the labels directly in my fields using the twitter bootstrap method.

I thought it was pretty simple using a hook_form_alter or the template_preprocess_views_exposed_form, but finally not. I discovered that these exposed filters don't have #title and the the label is managed separately and so, its quite hard to modify.

Do you have any suggestion to do that ? Because I don't know how can I get the label of the fields I want to modify. If I look into the views-exposed-form.tpl.php, I see that the widget is displayed using

print $widget->widget

with all the html in it, so I can't modify it easily here too... I'm stuck :/




dawehner’s picture

Historically a different template have been used, so you have actually views-exposed-form.tpl.php and can theme it relative easy.

We can't fix that in D7 as you don't want to break stuff.