Search code examples
sitecoresitecore8sitecore8.2sitecore-sxa

Extending Sitecore Experience Accelerator (SXA) Toolbar


We are using SXA toolbar to use common tools. We have also a lot of internal components and want to add it to SXA toolbar so that we can distribute our own components to our Sitecore team through toolbar.

So our specific question is that how to add our own components to SXA toolbar? Has someone extended SXA toolbar with their own existing components?


Solution

    • You need to make sure that your controller inherits from SXA's StandardController.
    • Your rendering should have a rendering parameters template , inheriting from /sitecore/templates/Foundation/Experience Accelerator/Rendering Variants/Rendering Parameters/IComponentVariant and /sitecore/templates/Foundation/Experience Accelerator/Presentation/Rendering Parameters/IStyling. This will give it the variant and styling options.
    • In your view, add <div class="component my-thingy @Model.CssClasses.Aggregate()">
    • Optionally have your model derive from RenderingModelBase
    • Add your component to the available renderings in your site's presentation folder.

    That should do it.