Copied to clipboard

Flag this post as spam?

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


  • vaibhav 119 posts 139 karma points
    Apr 15, 2011 @ 13:14
    vaibhav
    0

    showing 2nd level childs

    Hi,

    I Have

    Node1

    >subnode 1

    >>1subnode 1

    >>1subnode 2

    >subnode 2

    >>2subnode 1

    >>2subnode 2

    i want to create xslt where i can shoe

    Node 1

    >subnode 1

    >subnode 2

    I want to show this even i am on some other on website ... (i can use name Node1 as itt is constant...) ..can any 1 help me plz....

     

  • Pasang Tamang 258 posts 458 karma points
    Apr 15, 2011 @ 13:46
    Pasang Tamang
    0

    Hi

    Here is one trick.

      <xsl:template name="menu">
        <xsl:variable name="topNode" select="$currentPage/ancestor-or-self :: *[@isDoc] [@level=1]"/>
          <xsl:for-each select="$topNode/descendant::*[@isDoc][@level = 2] ">
            <xsl:value-of select="@nodeName"/>
    <xsl:call-template name="subMenu"/>
          </xsl:for-each>
      </xsl:template>
      <xsl:template name="subMenu">
      <xsl:variable name="children" select="umbraco.library:GetXmlNodeById(@id)/*[@isDoc]"/>
      <xsl:if test="count($children) > 0">
        <xsl:for-each select="./descendant::*[@isDoc] [@level = 3] ">
            <xsl:value-of select="@nodeName"/>
       </xsl:for-each>
      </xsl:if>
    </xsl:template>

    Pnima

  • 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.

    Continue discussion

Please Sign in or register to post replies