Copied to clipboard

Flag this post as spam?

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


  • Ian Banks 24 posts 44 karma points
    Nov 05, 2010 @ 15:56
    Ian Banks
    0

    Output unique nodes

    Hello

     

    I have a for-each that outputs some nodes, there are ocassions where the same node is rendered muliple times, is there a way check that only  unique nodes get rendered?

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Nov 05, 2010 @ 16:03
    Chriztian Steinmeier
    0

    Need more input :-)

    Show us the XSLT and we'll give you the tools to fix it.

    /Chriztian 

  • Ian Banks 24 posts 44 karma points
    Nov 05, 2010 @ 17:12
    Ian Banks
    0

    Ok I'm using blog 4 Umbraco and I want to create a list of the latest blog contributors, so this means that I am going to create list of links to the recently updated blogs. The problem I have is that suppose a person creates two posts, then that person will appear in the list of contributors twice where as I only want them to appear once, so my question is can I only show unique blog nodes. Not sure if that is any clearer. Thanks

     

    <xsl:for-each select="$currentPage/descendant-or-self::node[@nodeTypeAlias='BlogPost']">
                <xsl:sort order="descending" select="@createDate" />
                <xsl:variable name="blogParent" select="ancestor::node[@nodeTypeAlias='Blog']/@id" />
                <xsl:variable name="blogParentName" select="ancestor::node[@nodeTypeAlias='Blog']/@nodeName" />
                <xsl:if test="position() &lt; $numOfBlogs">
                    <li>
                        <a>
                            <xsl:attribute name="href">
                                <xsl:value-of select="umbraco.library:NiceUrl($blogParent)"/>
                            </xsl:attribute>   
                            <xsl:value-of select="$blogParent"/>
                        </a>
                       
                    </li>
                </xsl:if>
            </xsl:for-each>

Please Sign in or register to post replies

Write your reply to:

Draft