2

I'm using Sitecore 9.1.1 and SXA 1.8.1.

I have the following structure: A shared site in which i create the page designs, partial designs and rendering variants. And I have another two sites: Site A and Site B.

I have a case in which there is a page content structure component defined in the shared site, and two different rendering variants for this component defined in each of site A and site B.

I need to set the rendering variant of this component to be chosen according to the current site. I know I could do that for the datasource parameter using query: $site/Data/...., however, the rendering variant parameter is a dropdown menu in which I have to choose one variant for both sites.

Is there a way to make the rendering variant different in each site just like the datasource parameter?

1 Answer 1

0

I don't think it's possible to use a query at that point. What you could try is using personalization. And here it depends on how different the variants are...

If feasible, you could merge the variants into one and use the rules engine to show/hide sections (or other variant parts) depending on the site.

If this would get too complicated (or not maintainable) you migth need to personalize on the variant itself. Too bad, that is not possible ootb.

But.. check this question on personalizing variants: Does Sitecore SXA supports personalization between rendering variants?

Ootb this is not possible, but James Gregory appears to have done this for you: https://www.americaneagle.com/blog/web-development-blog/james-gregory/2017/09/20/parameter-personalization

His module can be found on the marketplace as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.