Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Sean 141 posts 179 karma points
    Jun 21, 2012 @ 05:41
    Sean
    0

    Umbraco 4.7.2, using razor defining sections and including views dynamically

    Hi There,

    After the recent demise of the Umbraco v5 project. I've decided to move the project I'm in the middle of to version 4.7.2. Not having used razor in v4 before I was wondering if I'm able to define sections in my layout files etc. Or is this functionality not available?

    Thanks in advance

    Sean


    <
    div id="columns" class="@View.LayoutClass">
       
    <div id="mainColWrap">
           
    <div id="mainCol">
               
    @RenderBody()
           
    </div>
       
    </div>
       
    @if (View.ShowLeftCol){
       
    <div id="leftCol">
           
    @RenderSection("LeftCol", required: false)
       
    </div>
       
    }
       
    @if (View.ShowRightCol){
       
    <div id="rightCol">
           
    @RenderSection("RightCol", required: false)
       
    </div>
       
    }
    </div>
  • Scott Williams 14 posts 71 karma points
    Jun 21, 2012 @ 09:16
    Scott Williams
    0

    currently there is no support for this using the default macro/razor system in umbraco4 but you have 2 options availible to you to use the UmbraMVCo package giving you MVC rendering and therefore razor based layout pages or the Razor Rocks package both support this scenario it two slightly differnet ways.

    I've not used ether package on a live site yet so I can't promise how well ether will preform.

    Also to then get true macro rendering support you can then use my package Razor Components razor components has been tested to work against UmbraMVCo (you might have to get the latest source version ofr it to work they had a bug) i've not looked to see if RazorRocks exposes the Library helper class that my Project extends.

  • Sean 141 posts 179 karma points
    Jun 21, 2012 @ 23:40
    Sean
    0

    thamks for the info Scott.

Please Sign in or register to post replies

Write your reply to:

Draft