Copied to clipboard

Flag this post as spam?

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


  • pat 124 posts 346 karma points
    Mar 02, 2012 @ 17:38
    pat
    0

    get all nodes of given doctype from home page

    version 4.7.1

    I am generating xslt to display all documents of Type "PersonalUpdatePage" , current page is home page, and this document type not straignt under home page, it can be under any other folders and any level.

    how to do this?

     I tried below didn't work for me.

      <xsl:for-each select="umbraco.library:GetXmlAll()//node [@nodeTypeAlias='DisastersPage']/node [@isDoc and   string(umbracoNaviHide) != '1']">

      <xsl:for-each select="umbraco.library:GetXmlAll()//node [@nodeTypeAlias='DisastersPage' and @isDoc and   string(umbracoNaviHide) != '1']">

      <xsl:for-each select="currentPage/ancestor-or-self::* [@nodeTypeAlias='DisastersPage']/node [@isDoc and   string(umbracoNaviHide) != '1']">

  • Sebastian Dammark 583 posts 1407 karma points
    Mar 02, 2012 @ 17:46
    Sebastian Dammark
    0

    Try this:

    <xsl:for-each select="$currentPage/ancestor-or-self::*[@level = 1]/descendant-or-self::DisastersPage[@isDoc and not(umbracoNaviHide = 1)]" />

    For more info on xpath axes this webpage is awesome: http://pimpmyxslt.com/axesviz.aspx

  • Nigel Wilson 945 posts 2077 karma points
    Mar 02, 2012 @ 18:54
    Nigel Wilson
    0

    Hi Pat

    The code you quote is for an old xml schema and not the schema within 4.7.1

    Assuming you are always going to be on the home page and not needing to traverse back up to the home page then this should work:

    <xsl:for-each select="$currentPage//PersonalUpdatePage[@isDoc and not(umbracoNaviHide = 1)]" />

    The double slashes indicate to get all matches below the home page irrespective of the depth.

    HTH

    Nigel

     

Please Sign in or register to post replies

Write your reply to:

Draft