Copied to clipboard

Flag this post as spam?

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


  • CelticHarp 12 posts 52 karma points
    Feb 28, 2013 @ 10:56
    CelticHarp
    0

    Use umbraco helpers at macros (v.4.11)

    I would like to use

    Umbraco.Content

    and

    Umbraco.GetDictionaryValue

    inside my macros (using MVC Partials).

    How can I use it?

    I currently use CurrentModel.NodeById() but it seems to be deprecated,

    I also used Library.NodeById but I want a strongly typed model. not a dynamic one.

    Thanks

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Feb 28, 2013 @ 12:14
    Jeroen Breuer
    0

    The Umbraco helper should be available if you're using MVC partials. What does your view inherit from?

    Jeroen

  • CelticHarp 12 posts 52 karma points
    Feb 28, 2013 @ 13:23
    CelticHarp
    0

    Oh, sorry. I forgot to mention the inheritance.

    From umbraco.MacroEngines.DynamicNodeContext.

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Feb 28, 2013 @ 13:28
    Jeroen Breuer
    0

    You're using the old macro's. You only have the Umbraco helper available if you inherit from Umbraco.Web.Mvc.UmbracoTemplatePage.

    Jeroen

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Feb 28, 2013 @ 13:31
    Jeroen Breuer
    100

    Maybe it should be Umbraco.Web.Macros.PartialViewMacroPage. You'll need to use Partial View Macros. In v6 you can edit them inside Umbraco: http://issues.umbraco.org/issue/U4-1303

    Jeroen

  • CelticHarp 12 posts 52 karma points
    Mar 01, 2013 @ 12:17
    CelticHarp
    0

    Thank you that solved my problem. :)

Please Sign in or register to post replies

Write your reply to:

Draft