1

I have my shop set up in Drupal Commerce. I have added search API and configured facets for things like taxonomy terms, which are perfect.

However on my product display nodes, there are a set of values that are boolean on/off checkbox fields for different attributes. These are...

  • Vegan friendly
  • Vegetarian
  • Contains sugar
  • Won a taste award
  • Contains gluten
  • Contains Alcohol

But they are showing their 1 or 0 key values for the boolean. Is there anyway to name these facet values?

enter image description here

I want to hide the 0, hide the block titles, rename the "1" to the block title, and then group them all together with CSS. The only thing im stuck on is renaming the 1 value.

I appreciate any help!

1

I downloaded Facet API Bonus module, and used the exclusion option to hide fields that were "false" or "0".

I then went into the content type and changed the "1" value to what I wanted it to say.

Along with a little CSS around the field to neaten it up, I now have exactly what I was after.

| 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.