Copied to clipboard

Flag this post as spam?

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


  • Eran Meir 401 posts 543 karma points
    Apr 07, 2011 @ 22:49
    Eran Meir
    0

    intellisense of model

    hi, i'm trying to work on my first macro.

    i've created a cshtml file, i create a foreach loop but i can get intellisense for Model

    please help.

    thank you :)

  • Eran 292 posts 436 karma points
    Apr 08, 2011 @ 01:28
    Eran
    0

    first of all as you know i'm also new i'n  razor macros...

    but i found that if i use CurrentModel instead of Model, i get the intellisense.

    from my checks its the same object, please someone correct me if i'm wrong.

    another tip that i can give you, is to download the umbraco source and take a look on the file:

    \umbraco_b9d17b6ddfe2\umbraco.MacroEngines.Juno\RazorDynamicNode\DynamicNode.cs

    and you will get all the properties, functions, etc. of this object.

    good luck! yesturday i did my first macro - a customized sub navigation for my needs. it was no so easy after using xslt in the past year.. but at the end, i get really nice and short code. i'm sure after practice we can have some really nice results.

  • kows 81 posts 151 karma points c-trib
    Apr 08, 2011 @ 08:41
    kows
    0

    @using umbraco.MacroEngines

     

    @{

    var myModel = (DynamicNode) Model;

    myModel.

    }

     

    from the razor movie @ http://www.buug.be/en/events/umbraco-festival

  • Eran Meir 401 posts 543 karma points
    Apr 08, 2011 @ 09:44
    Eran Meir
    0

    eran - what is CurrentModel?
    kows thanks ! that's exactly what i was looking for

  • Sebastiaan Janssen 5061 posts 15544 karma points MVP admin hq
    Apr 08, 2011 @ 09:49
    Sebastiaan Janssen
    0

    Eran is correct, instead of writing Model, write CurrentModel and you'll see. It does exactly the same as the code that kows posted, but without all the code. ;-)

  • Eran Meir 401 posts 543 karma points
    Apr 08, 2011 @ 09:58
    Eran Meir
    0

    i have Model, but no CurrentModel :s

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

    Continue discussion

Please Sign in or register to post replies