Search code examples
sitecoresitecore-mvc

Sitecore MVC, Controller accessing item fields without creating a model


Is there a way to access a sitecore item field without creating a model? So that I can build a more dynamic template.


Solution

  • you can have in your view:

    @using Sitecore.Mvc.Presentation
    @using Sitecore.Mvc
    @model RenderingModel
    @Html.Sitecore().Field("Title")<br />
    @Html.Sitecore().Field("Image")<br />
    @Html.Sitecore().Field("Text")<br />