As a test, I wanted to create a rendering for an SXA site. It had to be added to the toolbox and have a controller, model, and view.
I read this Creating new renderings that are compatible with SXA and now I am somehow confused as in that answer only the controller and rendering parameters are mentioned and I remember this slide from the Sitecore Symposium:
Here they also mentioned:
- adding a div to my view
- implementing IRenderingModelBase for the model
So now my questions are:
- Do I need to do add this div to the view and what if I don't?
- Do I need to implement that interface and what will I benefit (or what will I miss if I don't)?
- If I have a custom model that implements this interface, what is the best way to fill all the properties involved? I found a
GetModel()in the controller and a
ModelRepositorythat might help but then I need to copy the values..