Copied to clipboard

Flag this post as spam?

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


  • Ian Banks 24 posts 44 karma points
    Nov 05, 2010 @ 12:26
    Ian Banks
    0

    getting parent url using niceUrl

    Hello probably really simple question, could someone tell me how to get the parent url of the current node in context using NiceUrl?

  • Chriztian Steinmeier 2798 posts 8788 karma points MVP 7x admin c-trib
    Nov 05, 2010 @ 12:32
    Chriztian Steinmeier
    1

    Hi Ian,

    Just pass the parent's id into the function:

    <xsl:value-of select="{umbraco.library:NiceUrl($currentPage/../@id)}" />

    /Chriztian

  • Ian Banks 24 posts 44 karma points
    Nov 05, 2010 @ 14:24
    Ian Banks
    0

    Thanks

  • Hendy Racher 863 posts 3849 karma points MVP 2x admin c-trib
    Nov 24, 2010 @ 14:10
    Hendy Racher
    0

    Hi, thought I'd mention that it can also be done directly on a template with:

    <%= umbraco.library.NiceUrl(Node.GetCurrent().Parent.Id) %>

    edit: oops just noticed this is in the XSLT forum - I can't delete this...

  • Colin Browne 31 posts 52 karma points
    Nov 29, 2010 @ 13:09
    Colin Browne
    0

    You can use:

     

    <xsl:value-of select="{umbraco.library:NiceUrl($currentPage/@parentID)}" />
Please Sign in or register to post replies

Write your reply to:

Draft