Copied to clipboard

Flag this post as spam?

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


  • Anton Oosthuizen 206 posts 486 karma points
    Nov 24, 2014 @ 12:29
    Anton Oosthuizen
    0

    Accessing Umbraco CurrentPage when inheriting MerchelloViewPage

    Hi All

    How do I access the umbraco CurrentPage when inheriting MerchelloViewPage?

    Thanks

  • Alex Lindgren 159 posts 356 karma points
    Nov 24, 2014 @ 16:41
    Alex Lindgren
    0

    I'm not using MerchelloViewPage in the project I'm working on, but it looks like it inherits from Umbraco.Web.Mvc.UmbracoViewPage, so you should be able to access the Umbraco Helper (see http://our.umbraco.org/forum/developers/api-questions/52597-What-is-the-difference-between-UmbracoViewPage-and-UmbracoTemplatePage#comment182865)

  • DFBerry 53 posts 130 karma points
    Nov 24, 2014 @ 17:22
    DFBerry
    0

    I can use something like this in a partial view via the backend:

    @Umbraco.Field("pageName")

    If there is a specific property or line of code that is failing, please post it so we can take a look.

     

     

     

  • jivan thapa 194 posts 681 karma points
    Nov 24, 2014 @ 19:32
    jivan thapa
    0

    What's about this one

    // UmbracoContext.Current.PageId returns currentPageId

    var c = Umbraco.TypedContent(UmbracoContext.Current.PageId);
    
  • Anton Oosthuizen 206 posts 486 karma points
    Nov 24, 2014 @ 23:00
    Anton Oosthuizen
    0

    Hi Thanks

    With all the changes to Umbraco I get a bit lost but I managed to access it with

    @Umbraco.AssignedContentItem

  • Tessa 20 posts 72 karma points
    Nov 30, 2015 @ 16:13
    Tessa
    0

    I managed to do it like this:

    dynamic c = Umbraco.Content(UmbracoContext.Current.PageId);
    

    and then use "c" as you would "CurrentPage" normally.

  • 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.

Please Sign in or register to post replies