For custom renderings that are compatible with SXA, should we always use Controller Renderings? My understanding is that you must use a controller that inherits from SXA's StandardController or VariantsController.


You don't have to but it is easier right now as there are only Controller Renderings in SXA.

We did not create any View Renderings so it is not standardised and SXA does not provide any base classes for solutions based on View Rendering.

This is probably an area for improvement that SXA team could work on.

Of course if you manage to restore all required features on you View Rendering you can use them.

The most important part of each component is the following piece of code:

<div class="component NAME @Model.CssClasses.Aggregate()">
    <div class="component-content">


Consequences of skipping that part can be found here: https://sitecore.stackexchange.com/a/2326/16

|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.