how to allow only 1 out of the 3 exposed filter to be selected

Created on 26 September 2024, 2 months ago

Problem/Motivation

@sascha_meissner, thank you for updating the documentation on the module page!

I'm trying to accomplish the following...my view has 5 exposed filters. I want them all to be visible initially. However for 3 of the exposed filters (compound, mass, formula), only 1 of them should be chosen at a time...for example if the user clicks on a value for the mass exposed filter, then the compound and formula exposed filters should be disabled (not selectable). I'm not quite sure how to accomplish this and help is greatly appreciated.

💬 Support request
Status

Active

Version

1.2

Component

Documentation

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @monaw
  • 🇩🇪Germany sascha_meissner Planet earth

    Hey Monaw,

    disabling filters in the way the html attribute "disabled" would do for a "vanilla html input" is not supported by this module, but that is due to the fact that exposed filters and their html-structure can also be extended or manipulated in any thinkable way.

    Though you can easily hide/remove the filters with this module accordingly so that only 1 of the three filters can be chosen at a time.

    Lets assume your "active value" is the string "on" and dff1=compound,dff2=mass,dff3=formula
    then, for example, you could use the neq condition (not equals) on the compound admin lable like:

    dff2|{neq:on}|AND|dff3|{neq:on}|
    

    This way the compound filter will only be shown if neither mass or formula is selected. You can use the same logic for the mass and formula input as well and achieve your desired behaviour.

    PS: Sry for the late reply, i´m on a longer family getaway, hope my answer still helps you

Production build 0.71.5 2024