Copied to clipboard

Flag this post as spam?

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


  • jonok 297 posts 658 karma points
    Jul 15, 2009 @ 13:18
    jonok
    1

    Get values of the current node, load a node by its id

    I want to display different menus depending on the document type of the current page. Does anybody know the XSLT for retrieving the @nodeTypeAlias (and other values) for the current page? I know the $currentPage param contains information for all pages, but how do I just select the current page node?

    And then I want to load a menu by selecting a top level node by its id, so how do I load a node by its id? eg: if the top level node id I want to use is 1048, then I want to call a menu template in this fashion (bold indicates the part I need help with):

    <xsl:call-template name="RenderMenu">
    <xsl:with-param name="parent" select="node(1048)"/>
    </xsl:call-template>

    Thanks

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jul 15, 2009 @ 13:27
    Dirk De Grave
    102

    nerdalert,

     

    $currentPage contains info about current node as well, so

    $currentPage/@nodeTypeAlias

    does give the document type of the current page being processed.

     

    node(1048) needs to be replaced with

    umbraco.library:GetXmlNodeById(1048)

    (Also have a look at the wiki pages)

     

    Cheers,

    /Dirk

  • jonok 297 posts 658 karma points
    Jul 15, 2009 @ 13:34
    jonok
    0

    Thanks Dirk, looks like there's loads of useful extensions in the Umbraco.Library

Please Sign in or register to post replies

Write your reply to:

Draft