2

I have a SXA Carousel component on my homepage I would like to personalize. I added a few rules and associated datasources for each of them.

Then I noticed the same datasource was always used, no matter the pattern card assigned, so I erased the shared datasource of the rendering

enter image description here

Now, the carousel is always white, I can see it displays the right number of slides but they are empty:

enter image description here

Is that because I did not add the slides manually in the experience editor but just added the slides as children of my carousel in content editor ?

Is there another reason ? Please help

2 Answers 2

1

I appeared to have the same problem. I have debugged the code, and composite model gets filled properly. I think the problem comes from the dynamic placeholders not being filled with the slides (Page Content renderings).

After de-compiling SXA's source code, I found the following piece of code (in Sitecore.XA.Feature.Composites.Pipelines.GetXmlBasedLayoutDefinition InjectCompositeComponents) was assigning placeholders to children.

enter image description here

I think this is the source of the problem and thus we can't do anything but ask for Sitecore's help.

1
  • I confirm and would add: when I set a datasource to the Carousel rendering (not in personalization) and add a personalization, I can see in debugger the proper slides are loaded in the Carousel's Model but the default ones are loaded in placeholder. Thanks for your return :) Jul 7, 2017 at 13:43
1

Not being able to edit SXA's code, here is the ugly workaround I found.

Its main drawback is that it doesn't take benefit from the rendering variants. But at least it works.

In Carousel.cshtml, depending on the template used for the slide, I invoke the right html instead of creating a placeholder for a slide,

@if (composite.Value.TemplateID.Equals(StandardSlideID)))
    {
         @Html.Partial("../StandardSlide/StandardSlide", new StandardSlide { Item = composite.Value })
    }

@if (composite.Value.TemplateID.Equals(TestimonialSlideID))
    {
         @Html.Partial("../TestimonialSlide/TestimonialSlide", new TestimonialSlide { Item = composite.Value })
    }

I have to admit I'm a bit disapointed SXA isn't fully tested even with personalization which is one of my favourite Sitecore feature

Your Answer

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

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