1

I'm trying to implement SXA search functionality using the standard search box and search results components.

My question is if there is a way to dynamically change the rendering variant on the search results component for different page types returned in the result list?

By default there is only one rendering variant that can be defined on

There is a similar question here but it was raised some time ago so maybe with SXA 1.8, there is a way of doing that.

Thank you, Emanuel

3

There is no such option in SXA 1.8 - the answer from the previous question still stands.

As rendering variants won't render fields which don't exist, you can use that. If that is not sufficient, the rules engine might help. You can add fields (or even sections) and use the rules engine to show/hide them based on rules that can verify your page types.

SXA 1.8 did add an option to use renderings inside a variant. If you really want very different result views, that might be helpful in creating different results without having a massively complex rendering variant on the search results.

  • Thanks @Gatogordo for confirming. It works nicely by using the rules. – Emanuel Popescu Jan 15 at 13:47

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.