Copied to clipboard

Flag this post as spam?

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

  • Martin 18 posts 73 karma points
    Jun 13, 2012 @ 14:03

    Razor: Dynamicnode and Macro with model. from elsewhere

    as title says i have a razor macro pulling information from another node ( dynamic), and on that node is a macro, that i need to pull ...


    @using umbraco.MacroEngines
    @inherits umbraco.MacroEngines.DynamicNodeContext
    @if (PageData.Count > 0){
            dynamic Library  = new DynamicNode(PageData[0]);

    and under that i can use 


    to pull information from the page.

    However now i have this macro that pulls lots of fields from that page depending on dates.


    and in that macro i am using Model.Fieldname for information and checking of dates.

    Now, i get that Model in this case isnt correct as the pagedata thingy is something different.

    so basicly, how do i pull the model.fieldname from the renderpage script on this page?

    example of field in the renderpage macro

    if ((Model.visasFranPask<DateTime.Now.Date) && (Model.visasTillPask>DateTime.Now.Date)) {
            <h2>@Dictionary.EasterOpeningHours </h2>


  • Martin 18 posts 73 karma points
    Jun 13, 2012 @ 15:54


  • seanrock 101 posts 185 karma points
    Jul 16, 2013 @ 09:03

    just a guess...


Please Sign in or register to post replies

Write your reply to: