I'm creating some new standard Sitecore components and really like how the rendering variants are used in SXA to differentiate between different component variations.

Has anyone implemented anything similar for a non SXA Site instead of using Rendering Parameters or separate components for each variation?

I'm guessing this would involved creating a custom ChromeToolbar something like: https://stackoverflow.com/questions/28948192/add-a-custom-dropdown-list-in-sitecore-pageeditor.

enter image description here

  • Why do you say "instead of using Rendering Parameters"? Would there be a problem with that? It should be quite simple to have a rendering parameter dropdown where you swap the rendering (cshtml file to use) then read that parameter in the controller and serve up the corresponding view (with the same model). – Matthew Dresser Jul 10 '19 at 9:18
  • Yeah thats what I'd usually do but It's a bit hidden under the 'more v' button, it's an extra two clicks, content editors need to wait for the window to open so this would be much more visible and easier to use. If it's been selected as a good approach for choosing between rendering variations in SXA then it seems to make sense to use this in Standard Sitecore too. I'm interested in what others think about this though. – Adam Seabridge Jul 10 '19 at 9:41
  • 1
    Probably a custom edit frame would help here then. I'm guessing that SXA uses the rendering parameters anyway to store the variant selection. Maybe time to crack out dotPeek... ;-) – Matthew Dresser Jul 10 '19 at 10:12
  • 1
    yeah I guess so. I'll need to re-install SXA as I've blitzed that install recently but I'll dig into it a bit once I do. I'm hoping that rendering params are used under the hood as that would mean the same approach could be utilised maybe. – Adam Seabridge Jul 10 '19 at 10:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.