0

I am using Sitecore 9.0 with SXA and have a custom Rendering that I want to add the SXA toolbox for each site that I create.

It is of course possible to do this manually (as described here), but I would like to have it automatically added to each new site.

I read about extending the site & tenant scaffolding extension possibilities, but it feels a bit heavy for my purpose.

What is the best practice to automatically add Renderings to the SXA toolbox?

  • 1
    Use the scaffolding extension. It might seem heavy but you don't need to start from scratch.. copy the needed items from existing ones and adjust. And if it takes some time on the first attempt, remember it will go faster the second time.. ;) – Gatogordo Mar 22 '19 at 9:00
1

1) You should really follow official best practices and create your own module and add that custom rendering there based on these instructions: https://doc.sitecore.com/developers/sxa/17/sitecore-experience-accelerator/en/add-modules-to-site-and-tenant-scaffolding.html

Then add that module to your site.

2) However there is quicker solution to be used only for development purposes IMHO. Just add new Available Renderings item based on /sitecore/templates/Foundation/Experience Accelerator/Presentation/Available Renderings/Available Renderings template. Name it "Custom" or something similar and in Renderings field, add your desired rendering:

enter image description here

You will then see it in Toolbox:

enter image description here

Mind that the section name is taken from where the custom rendering sits not from your item created above.

Use this option only when there are no rendering variants or data sources under site Data folder needed for your custom rendering!

As you can see on picture, rendering is not usable as Rendering Variants are missing...

You can duplicate this item between sites or create some Powershell script to create it for you but the best automation is to use first option ;)

| improve this answer | |

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.