Just playing around with Sitecore 7 and MVC, and I try to get the rendering basics working.
So far, I have been able to create a View Rendering (and mapped to the relevant .cshtml file) within the Renderings section, and applied these to the presentation details of the item (in much the same way you do with ASPX Layouts/ASCX Sublayouts).
I have also been able to map the Item to a controller (using the Controller and Action fields on the item), have the Index
action on the controller (inherited from SitecoreController
) return the view ~/Views/Home/Index
.
The issue I can't seem to wrap my head around is merging the two rendering methods. I want to be able to create controllers that map to an Item
, but render the item using the ViewRenderer
, rather than using the default MVC conventing of return View()
, so that I can:
- Specify the location of the view files within a multi-site environment by setting the path parameter of the rendering; and
- Have content authors/managers manage the renderings the way that the Layout/Sublayout does with place holders.
Does anyone know of a way that this can be achieved?