2

I'm trying to edit an overlay content component in the Experience Editor but i just realized that i can't use SXA components such as Rich Text, Links etc (The drag & drop works but once it's dropped, nothing is displayed in the placeholder).

I don't have this problem with components i've created myself and added to the toolbox.

If anyone can put some light on that problem. Thank you for your help !

2
  • What is your SXA version, 1.5? Commented Feb 12, 2018 at 14:22
  • @AlanPłócieniak : Yes, v1.5
    – Slrg
    Commented Feb 12, 2018 at 14:26

1 Answer 1

4

This is a known issue in SXA 1.5, it was fixed in SXA 1.6 so if you can I highly recommend you to upgrade.

Rendering Variants do not work on Overlay items thus you cannot see renderings because they have no default rendering variant selected.

You can still assign RV in Raw Values but I think this is not a solution

Quick fix:

Custom service

Add missing Overlay template and it will be fine. In 1.6 this collection was extracted into a configuration so it is much easier to add additional templates that do not inherit from any of the existing base templates (Page, Overlay, Partials...)

namespace Alan.Services
{
    public class AvailableRenderingVariantService : Sitecore.XA.Foundation.Variants.Abstractions.Services.AvailableRenderingVariantService
    {
        public AvailableRenderingVariantService()
        {
            AllowedTemplates = new List<ID>(AllowedTemplates) { Templates.OverlayContent.ID }.ToArray();
        }
    }
}

Custom service - registration

namespace Alan
{
    public class RegisterVariantsAbstractionsServices : IServicesConfigurator
    {
        public void Configure(IServiceCollection serviceCollection)
        {
            serviceCollection.AddSingleton<IVariantFieldParser, VariantFieldParser>();
            serviceCollection.AddSingleton<ITemplateRenderer, TemplateRenderer>();
            serviceCollection.AddTransient<IVariantRenderer, VariantRenderer>();
            // HERE YOU REGISTER YOUR CUSTOM SERVICE
            serviceCollection.AddSingleton<IAvailableRenderingVariantService, Services.AvailableRenderingVariantService>(); 
            serviceCollection.AddSingleton<IVariantRenderingService, VariantRenderingService>();
            serviceCollection.AddSingleton<IRulesService, RulesService>();
        }
    }
}    

Configuration

<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
    <services>
    <configurator patch:instead="*[@type='Sitecore.XA.Foundation.Variants.Abstractions.Pipelines.IoC.RegisterVariantsAbstractionsServices, Sitecore.XA.Foundation.Variants.Abstractions']" type="Alan.Services.RegisterVariantsAbstractionsServices, Alan" />
    </services>
</sitecore>
</configuration>    

Once you update to 1.6 you have to remove this fix.

0

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.