Copied to clipboard

Flag this post as spam?

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


  • Anders Brännmark 228 posts 280 karma points
    Oct 01, 2010 @ 14:15
    Anders Brännmark
    0

    Current document, in admin?

    In the middle of constructing a custom datatype using the usercontrol wrapper where I need to reference the parent of the document the datatype currently is on. Anyone know how to go about this?

     

  • Rich Green 2246 posts 4008 karma points
    Oct 01, 2010 @ 14:23
    Rich Green
    0

    You might like to look at the source of this project, as this has this functionality using $CurrentNodeId

    http://our.umbraco.org/projects/backoffice-extensions/tribal-xpath-node-relations

    Rich

  • Richard Soeteman 4054 posts 12927 karma points MVP 3x
    Oct 01, 2010 @ 14:33
    Richard Soeteman
    1

    Hi Anders,

    You could use, where Data is the IData object

    return

     

    ((umbraco.cms.businesslogic.datatype.DefaultData)(Data)).NodeId;

    Hope this helps you,

    Richard

  • Richard Soeteman 4054 posts 12927 karma points MVP 3x
    Oct 01, 2010 @ 14:35
    Richard Soeteman
    1

    Oh sorry,

    See that you are using the ControlWrapper don't know if that holds the IData object... Think not, In that case just use Request.Queystring["id"];

    Cheers,

    Richard

  • Anders Brännmark 228 posts 280 karma points
    Oct 01, 2010 @ 16:07
    Anders Brännmark
    0

    Thanks Richard,

  • 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