Copied to clipboard

Flag this post as spam?

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


  • Simon Dingley 1474 posts 3451 karma points c-trib
    Jan 06, 2010 @ 17:24
    Simon Dingley
    0

    Inline XSLT To Get Level 1 Node Name

    Can anyone enlightne me as to why the following returns no result?

    <umbraco:Item runat="server" xslt="$currentPage/ancestor-or-self::node [@level=1]/@nodeName" />
  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jan 06, 2010 @ 17:26
    Douglas Robar
    1

    Because you don't have a 'field=' specified.

    Even if you aren't using the field, you must specify it and the field must exist.

    Try this...

    <umbraco:Item field="pageName" runat="server" xslt="$currentPage/ancestor-or-self::node [@level=1]/@nodeName" />

    cheers,
    doug.

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jan 06, 2010 @ 17:29
    Dirk De Grave
    1

    Simon,

    I don't think $currentPage is known in the context of the umbraco:Item. I'd try:

    <umbraco:Item runat="server" xslt="umbraco.library:GetXmlNodeById({0})/ancestor-or-self::node [@level=1]/@nodeName" />

    and see if that works.

     

    Cheers,

    /Dirk

  • 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