Monday, January 4, 2016

Options for Sitecore MVC Architecture

One of the great things about Sitecore MVC, or MVC in general, or coding in general I guess, is that you have lots and lots of options.  Here is a great video that demonstrates some of the common ways you can architect your Sitecore MVC application:

https://www.youtube.com/watch?v=dW_rQp9bMmE

The basic choices are:

  • Use existing Sitecore pipeline, sans custom controller or custom model
  • Create a custom model, but use Sitecore's existing pipeline
  • Create a custom model and also a custom controller
  • Create a custom model with custom controller and repository
  • Create a view model, model, customer controller and repository
The deeper you go, the more "MVC" you get, but it's awesome that Sitecore allows you to use any of these options.

A few highlights:
If you want the page editor to work on your rendering, make sure to use the FieldRenderer.Render() method rather than just populating a string.


No comments:

Post a Comment