1

I need to add a field to a content type which is going to used as a exposed filter in Views.In this filter the visitor will see ranges. I've done this in the past and ended creating 2 fields to set both limits of a range. I need to remake this and I think this can be done in a smarter way.

What I need is:

1) create the content type: flat

2) add the field price to the content type flat

3) create a view Flats

4) create a exposed filter to filter by the field price but using ranges, e.g: "From 100 000 to 200 000", "From 200 001 to 300 000" and so on. I need these options to be a Select dropdown list.

Then my questions are:

  • about point 2): I would create a integer type field for this, is this right and enough?

  • about point 4): How do I do to create the ranges that I need? Maybe a module for this?

1 Answer 1

0

This module might help: Views Contextual Range Filter

Module Page Description:

Views Contextual Range Filter is a simple plugin for Views that adds the option to contextually filter not just by a single value, but also by range. Numeric, alphabetical (string) and list ranges are all supported. Node ids, user ids and even taxonomy term ids are all special cases of numbers so will work also. Range-filtering on the "created" (posted) and "updated" (last modified) node properties is also supported, provided you use the correct format as dictated by Views. So, YYYYMMDD for full dates or one of the shorter formats, i.e. year+month, year-only, month-only, week-only or day-only. You may use the OR operator (i.e. +) and the negate operator. You negate by ticking the "Exclude" box on the Views Contextual filter configuration panel, in the "More" section.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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