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 547 posts 1287 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 939 posts 2061 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

     

  • 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