Copied to clipboard

Flag this post as spam?

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


  • arash 3 posts 23 karma points
    Mar 24, 2014 @ 05:03
    arash
    0

    how to select all parent node with specific document type

    i need to get all parent node of current node with specific document type , i have tried all the following but they dont work. i tried google and etc.. i couldnt find working answer. so i posted it here 

     

    <xsl:for-each select="$currentPage/ancestor::* [@isDoc='News' and @level &gt; $minLevel]">

    <xsl:for-each select="$currentPage/* [name() = 'News' and string(umbracoNaviHide) != '1']">

     <xsl:for-each select="$currentPage/ancestor::*[@isDoc][not(self::NewsItem)] [ @level &gt; $minLevel]">

    thank you.

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Mar 24, 2014 @ 08:03
    Dennis Aaen
    0

    Hi Arash,

    How about something like this:

    <xsl:for-each select="$currentPage/../News[@isDoc and string(umbracoNaviHide) != '1][@level &gt; $minLevel]">
    </xsl:for-each>


    In the example the document type is called News, so remember to change it if necessary, so it match your setup. In Umbraco there are different axes you can work with in XSLT, you probably already know that. But here is some information about XPath axes and their Shortcuts. http://our.umbraco.org/wiki/reference/xslt/xpath-axes-and-their-shortcuts

    E.g to get the parent node:

    $currentPage/parent::*[@isDoc]

    Shorthanded method

    $currentPage/..

    Hope this helps,

    /Dennis

Please Sign in or register to post replies

Write your reply to:

Draft