Score:0

How do I apply different styles according to content type?

bf flag

in a view I'm filtering content with search API /facets. In the view (field format) i've applied a specific style for the results, some sort of Bootstrap card. IT apply to all content index by search API.

I need to apply different styles according to content type in the results: For the content type "rose" i use a bootstrap card, for the content type "wood" i use full width div with an image a button and a text.

How can i achieve that?

I tried to duplicate the view with the same path parameter (/search), and tried relation/contextual filter but it s not working. And as the view overwrite the display style of the search API "rendered_item", i cant use those, maybe i should?

Score:1
bf flag

Indeed, in the search API view, i had to change the "format display" from field to rendered entity, and in the parameter i choose a display format for the different content type. then i will customize if trough twig template, instead in the view with custom text as like that it apply to any content type.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.