Copied to clipboard

Flag this post as spam?

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


  • Lee 1123 posts 3059 karma points
    Jun 21, 2013 @ 16:09
    Lee
    0

    Umbraco 6 Get CurrentPage From Custom Class?

    I have a class that needs to know the CurrentPage? I can get access to the UmbracoHelper by doing this in my class

    var uHelper = new UmbracoHelper(UmbracoContext.Current);

    How do I get the CurrentPage

  • Ali Sheikh Taheri 470 posts 1647 karma points c-trib
    Jun 21, 2013 @ 16:46
    Ali Sheikh Taheri
    0

    can you pass the current page to your class?

     

     public static IPublishedContent YourMethod(IPublishedContent currentPage)

    //Your Code Here!
  • Lars-Erik Aabech 348 posts 1096 karma points MVP 4x c-trib
    Jun 21, 2013 @ 16:47
    Lars-Erik Aabech
    0

    Not sure which version it was implemented in, but you've got uHelper.AssignedContentItem if Umbraco found some content on the current url.

  • Lee 1123 posts 3059 karma points
    Jun 21, 2013 @ 17:00
    Lee
    100

    Thanks for the comments. I managed to get around it with a bit of a hack :)

  • Ali Sheikh Taheri 470 posts 1647 karma points c-trib
    Jun 21, 2013 @ 17:03
    Ali Sheikh Taheri
    0

    Hi Lee, 

    It would be nice to have your work around here as that can be used by other people in case they need it! 

  • 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