2

Creating real estate website, i have a lot of exposed filters. For year when the object is built i have number field which in views is as exposed filter. When user makes input he puts year 1961 for example.

User searching in exposed filter writes 1961 and filter is set up like "equal or higher" so he gets all objects made 1961 and higher. Works fine.

But i have a problem with floors. For floors i have vocabulary: ground floor 1 2 3 4 etc.. attic

I cant use number field because of ground floor and attic so i had to use taxonomy. But now i cant use equal or higer as exposed filter so if user picks number 3 he only gets appartments with 3 floors.

3

You could still use floors as numeric field, having numbers as keys and display output as needed.

Example of "List (integer)" values:

-1|Basement
0|Ground floor
1|1
2|2
3|3
100|Attic

This would allow you the same logic for floors.

EDIT:
When selecting the field as a filter in Views you need to choose the delta value. It looks something like Content: Floors (field_floors:delta). This will give you the integer filter options such as Is greater than or equal to.

7
  • This works but how can i achive "equal or higer" in views exposed filter with it ? I tried using slider but it works only with integer (ubfortunately not workung with List(integer) – Azz Kawa Feb 15 '13 at 23:34
  • For all integer fields you should be able to select Is greater than or equal in the field settings under Filter criteria in Views. – enzipher Feb 16 '13 at 0:30
  • I only have: " Is one of, Is all of, Is none of, Is empty (NULL), Is not empty (NOT NULL). (using "List (integer)" as field). – Azz Kawa Feb 16 '13 at 6:52
  • 1
    @BigBrother2010 When selecting field you have to choose the delta value. – enzipher Feb 16 '13 at 8:34
  • Cheers for helping out enzipher, but for some reason delta value is not visible for this field. – Azz Kawa Feb 16 '13 at 11:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.