2

I'm developing a recruitment website which will allow users to filter jobs by salary. It has been designed so that the filter is grouped into salary ranges like this...

enter image description here

I am using the Range module in order to add a range field to my job content type (essentially just two text boxes). The idea is that the admin can enter in any 'from' and 'to' integer (doesn't have to be a value that matches one of the filters e.g. £20–25k). Instead the query should be able to adapt and show any matching results.

The issue I have is that because I essentially have two fields saved there doesn't appear to be any simple way of grouping filters. I have attempted to use the Global: Combine fields filter but this only works with strings, not integers.

I've also attempted to add the Salary range filter included with the Range module under the Filter criteria heading of my view but this doesn't appear to work either. Here is a screenshot of what I attempted (I'm assuming that the Range module doesn't actually store the integers in-between the 'to and 'from' fields so I guess this wouldn't work. I'm also not sure that separating the values with commas is valid either).

enter image description here

The only method I can think of would be finding a way of adding the two fields together to create one total integer which would then allow me to use the standard is-between operator available when filtering a single field in Views.

Thanks in advance.

0

You might try the Contextual Range Module: https://www.drupal.org/project/contextual_range_filter

According to the documentation, this allows you to make a contextual filter based on a range (as opposed to just a single field value).

| improve this answer | |

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.