Here is the scenario. I have created a facet which list all GPA's (these are decimal numbers). e.g. 2.0, 2.5, 3, 3.5 etc.

What I wanted is when say a user choose 2.5 GPA from the facet, the returned contents should be contents that has a GPA of 2.5 and above.

I have been trying to figure it out using views alone, but I can't get it to work. If It can be done with just views, can you please suggest what to do? Or do you think this can only be achieved by code?


I wasn't able to find answers on how to solve this with Facets alone, or writing custom code which is related to facet API. Honestly, I've been ignoring the most obvious solution to my problem which is Views exposed filter, and this is how I managed to solve my problem:

  1. Create an exposed filter for GPA, which filters result that are greater than or equal to the provided GPA. I made this hidden by default.
  2. I disabled the GPA facet I was using, and wrote my own GPA filter block. It's just a matter of querying the GPA field table, disregarding duplicates.
  3. Wrote a custom script that captures the selected GPA value, from the custom GPA block I created, and then feed it hidden views exposed filter.
  4. I added few more customization to it so that it behaves exactly like the rest of the facets.
|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.