Copied to clipboard

Flag this post as spam?

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


  • Brad Slander 5 posts 25 karma points
    May 20, 2010 @ 12:43
    Brad Slander
    0

    Traversing nodes

    Hi folks,

    I am new to umbraco and xslt and I am having a problem with rendering the correct nodes to screen. My Content tree consists of:

    Content

    -Home

    --Sub Node - Folder

    ---Archive Node - Folder -- node id=1379

    ----January - Folder

    -------Page Node

    -------Page Node

    ----February Node - Folder

    -------Page Node

    -------Page Node

    What I require for each month to be rendered as the header and the page nodes as a drop down list (This has been set up using a jquery accordian).

    The problem I am getting is that the January folder is being rendered twice and the 4 page nodes are rendered underneath each January heading. Its quite obvious I am missing the point somewhere with XSLT and XPATH. Could some one tell me where I am going wrong please. My XSLT file is:

    <xsl:param name="currentPage"/>
    <xsl:variable name="startnode" select="umbraco.library:GetXmlNodeById(1379)"/>
    <xsl:template match="/">

    <div class="event-details">
    <h1><xsl:value-of select="$currentPage/@nodeName"/></h1>
    <div class="function-wrapper">
    <xsl:for-each select="$startnode/node">
    <h2 class="trigger"><a href="#"><xsl:value-of select="$startnode/node/@nodeName"/></a></h2>
    <div class="toggle_container">
     <div class="block">
      <ul class="list">
      <xsl:for-each select="$startnode/node/node">
       <li>
        <a href="{umbraco.library:NiceUrl(@id)}" title="">
        <xsl:if test="node!='false'">
         <xsl:attribute name="title"><xsl:value-of select="@nodeName" /></xsl:attribute>
        </xsl:if>
       <xsl:value-of select="@nodeName" /></a>
       </li>
      </xsl:for-each>
      </ul>
     </div>
    </div>
    </xsl:for-each>
    </div><!--end function-wrapper-->
    </div><!--end event-details-->
    </xsl:template>

     

    Thank you

  • Brad Slander 5 posts 25 karma points
    May 20, 2010 @ 14:30
    Brad Slander
    0

    sorry, wrong forum. I have moved this to the xslt forum

Please Sign in or register to post replies

Write your reply to:

Draft