Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
<div class="form-type-radio form-item-field-lot-und form-item">
....
</div>
How remove this wrapper to create inline radio or checkbox labels?
Comments
Comment #1
anikitin35 CreditAttribution: anikitin35 commentedHow to remove 'controls' and 'control wrapper' from views exposed filters forms?
Comment #1.0
anikitin35 CreditAttribution: anikitin35 commentedCode
Comment #2
j0rd CreditAttribution: j0rd commentedI've been looking at this today. I need inline radio and checkboxes.
Currently bootstrap theme is not outputting radios and checkboxes in the proper "bootstrap html way (tm)", so with out CSS hacks, or changes in code, this really won't work.
I looked into doing it myself, but after two hours I gave up. It's quite complicated due to Drupal expanding out a "radios" or "checkboxes" type into a bunch of individual "radio" or "checkbox" fields, and not using a wrapper.
Here's the bootstrap way:
http://getbootstrap.com/css/#forms-controls (search for "inline checkboxes")
Comment #3
markhalliwellThis has been fixed in 7.x-3.x already. The 7.x-2.x branch only receives security fixes.
Also this will likely get re-evaluated even more with the related issue.
Comment #4
jpchristie CreditAttribution: jpchristie commentedYou can do that in jquery (adding radio-inline for bootstrap compliance):
$('.form-type-radio label').addClass('radio-inline');
$('.radio-inline').unwrap('
');
$('.form-type-checkbox label').addClass('checkbox-inline');
$('.checkbox-inline').unwrap('
');
Comment #5
catFighter CreditAttribution: catFighter commentedOnly way is use this module https://www.drupal.org/project/vefl then you can create custom template for widget: views-exposed-widget.tpl.php or views-exposed-widget--NAMEYOURFILTERFIELD.tpl.php