Copied to clipboard

Flag this post as spam?

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


  • pnr 131 posts 226 karma points
    Mar 25, 2015 @ 16:17
    pnr
    0

    How to render macro on a view with a model

    I am using the Dialogue package on a solution. But it uses a model on the views (And is not inherting from UmbracoTemplatePage), so I can not access "@Umbraco.RenderMacro" and other Umbraco proterties. Is it somehow possible?

    Thanks very much in advance.

     

     

     


     

     

     

     

     

     

  • Jeroen Breuer 4859 posts 12120 karma points MVP 3x admin c-trib
    Mar 25, 2015 @ 16:41
    Jeroen Breuer
    100

    Hello,

    If you do this at the top of your page you should have those helpers available:

    @inherits Umbraco.Web.Mvc.UmbracoViewPage<model>

    Jeroen

  • pnr 131 posts 226 karma points
    Mar 25, 2015 @ 16:47
    pnr
    0

    Thanks very much!

    What if I shall use @CurrentPage.Id, is it possible to access that option?

  • Jeroen Breuer 4859 posts 12120 karma points MVP 3x admin c-trib
    Mar 25, 2015 @ 16:50
    Jeroen Breuer
    0

    I'm not sure if that works. It depends on if that page has the current node available. Just try it ;-).

    Jeroen

Please Sign in or register to post replies

Write your reply to:

Draft