Copied to clipboard

Flag this post as spam?

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


  • Biagio Paruolo 1494 posts 1635 karma points c-trib
    Mar 23, 2011 @ 17:32
    Biagio Paruolo
    0

    List Children of Child of one Node...How?

    How Do I loop on children of an hidden child of a node? That is:

    Content

      -- NodeA (it)

      ----  Hidden Node  (home)

      --------- Children1

      --------- Children2

      --------- Children3

     

    That is when I'm in NodeA, I wish children list of Hidden Node.

    I try with this

     <xsl:for-each select="$currentPage/ancestor-or-self::root/it/Home/*[@isDoc]">

    but nothing.

    Thanks

  • Chriztian Steinmeier 2726 posts 8320 karma points MVP 4x admin c-trib
    Mar 23, 2011 @ 22:57
    Chriztian Steinmeier
    0

    Hi Biagio,

    If $currentPage is "NodeA" and "Home" is the alias of the Document Type for the hidden node, you can very easily access the children of Home by doing this:

    <xsl:for-each select="$currentPage/Home/*[@isDoc]">
        <p><xsl:value-of select="@nodeName" /></p>
    </xsl:for-each>

    The fact that the node is hidden, is just a convention that if you use a property with the name umbracoNaviHide, the default XSLT "templates" (accessible in the Create XSLT file dialog) will skip nodes that have that property set. You can only truly hide a node from the XML by unpublishing it.

    /Chriztian

  • Biagio Paruolo 1494 posts 1635 karma points c-trib
    Mar 24, 2011 @ 10:47
    Biagio Paruolo
    0

    I try, but don't works...My script is:

    <xsl:value-of select="$currentPage/@nodeName"/>  --> this return "it" value
                  <ul class="tabbed">

                    <xsl:for-each select="$currentPage/Home/*[@isDoc]">
                       
                <li>
                  <xsl:if test="@id = current()/@id">
                    <xsl:attribute name="class">current-tab</xsl:attribute>
                  </xsl:if>
                  <a href="{umbraco.library:NiceUrl(@id)}">
                      <xsl:attribute name="id">nav-<xsl:value-of select="./umbracoUrlName"/></xsl:attribute>
                    <xsl:value-of select="@nodeName"/>
                  </a>

                </li>
              </xsl:for-each>
            </ul>

    I've empty list...

    It's not possible unpublish node because, after, I can not publish children.

  • Biagio Paruolo 1494 posts 1635 karma points c-trib
    Mar 26, 2011 @ 17:21
    Biagio Paruolo
    0

    I try this

    <xsl:for-each select="$currentPage/Home/*[@isDoc]">
            <p><xsl:value-of select="@nodeName" /></p>
    </xsl:for-each>

    and I've tested that I'm in node "it" with <xsl:value-of select="$currentPage/@nodeName"/> ,but "for-each" ( see up ) return empty value..

     

     

  • Chriztian Steinmeier 2726 posts 8320 karma points MVP 4x admin c-trib
    Mar 26, 2011 @ 21:27
    Chriztian Steinmeier
    1

    Hi Biagio,

    That simply means that "Home" is not the name/alias of the hidden Document Type - it's a case-sensitive name, maybe it's "home" ?

    You can also reference it by @nodeName - e.g., if it's called 'Home' in the Content Tree you'd do this:

    <xsl:for-each select="$currentPage/*[@nodeName = 'Home']/*[@isDoc]">

    /Chriztian

     

  • Biagio Paruolo 1494 posts 1635 karma points c-trib
    Mar 27, 2011 @ 13:05
    Biagio Paruolo
    0

    This work...Thanks

    <xsl:for-each select="$currentPage/*[@nodeName = 'Home']/*[@isDoc]">
  • 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