Copied to clipboard

Flag this post as spam?

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


  • Andreas Kaltenhuber 107 posts 286 karma points
    Oct 06, 2015 @ 09:53
    Andreas Kaltenhuber
    0

    Access IPublishedContent properties of current node

    Hi,

    whats the best way to access properties of the current node where i render the doctype grid editors.

    i have to read certain values of the umbraco document and render them in the partial views for the doctype grid. i do need this for the preview mode in the backend.

    in the frontend i have a workaround using a session variable where i store the actual page id in the masterview.

    thx in advance, andreas

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Oct 06, 2015 @ 12:17
    Jeroen Breuer
    101

    Hello,

    You can get the current Umbraco node like this:

    var currentNode =  UmbracoContext.Current.PublishedContentRequest.PublishedContent;
    

    Jeroen

  • Andreas Kaltenhuber 107 posts 286 karma points
    Oct 08, 2015 @ 07:38
    Andreas Kaltenhuber
    0

    Thx, works perfect!

    Andreas

Please Sign in or register to post replies

Write your reply to:

Draft