In a Drupal 9 with Search APi and Facets the aim is to make the views search api list with all items (lets call it the 'unused state') in an opaque state (or similar) and the facets in full opacity. This to make it clear, that no filters have been used yet and the user will directly go and use the facets. after using the facets the views result list will appear in full opacity.

I somehow need to generarte classes for one of this states and add a body class (or a class name on the view), so that I can do that.

Cant get my head around how to check for that state. Could do it with empty blocks maybe or the state of the url maybe (url being ..../f* if facets were used)

++++++++++++++++++++++++++ EDIT (some hours later):

Got it done using the 'Page Specific Class' module und passing a body class when the url is the base views url without any appendixes by filters or facets

Your Answer

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

Browse other questions tagged or ask your own question.