Copied to clipboard

Flag this post as spam?

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


  • pawel 22 posts 42 karma points
    Jan 14, 2012 @ 16:37
    pawel
    0

    list all checked documents in different folder

    Hi guys,

    I would like my documents to have property called "novelty" and list all the documents that has got it checkboxed. The problem is I want to display all these documents in completly different folder, have a look please:

     

    In other words I need to go sidewise, down and down again. How to do it, can you help?

    thanks in advance.

     

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Jan 14, 2012 @ 18:24
    Chriztian Steinmeier
    0

    Hi pawel,

    This should not be too difficult - to get all documents with the novely property checked, regardless of where in the structure you are, do this:

    <xsl:param name="currentPage" />
    <!-- Grab a handle to the root -->
    <xsl:variable name="siteRoot" select="$currentPage/ancestor-or-self::*[@level = 1]" />
    <!-- Grab all documents with the novelty property checked -->
    <xsl:variable name="allNoveltyDocs" select="$siteRoot//*[@isDoc][novelty = 1]" />
    
    <xsl:template match="/">
        <xsl:for-each select="$allNoveltyDocs">
            <p><xsl:value-of select="@nodeName" /></p>
        </xsl:for-each>
    </xsl:template>
    
    The // selector will check every element at any level (in this case below $siteRoot) - so if you know that the "novelty" docs can only be below a certain node, you should include that in the selector to improve performance, e.g.:
    <xsl:variable name="allNoveltyDocs" select="$siteRoot/Novelties//*[@isDoc][novelty = 1]" />

    /Chriztian

Please Sign in or register to post replies

Write your reply to:

Draft