Copied to clipboard

Flag this post as spam?

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


  • Alexey Shevchenko 15 posts 34 karma points
    Aug 31, 2011 @ 18:05
    Alexey Shevchenko
    0

    Get child nodes by parent id

    Hi all. Sorry if I duplicate someone else's post.

    I know "Project" page id. For example 1070. And I want to get Project's child (pr1, pr2, pr3).

    - Home
    - Project
     - pr1
     - pr2
     - pr3
    - About us 

    I've tried to do such:

    <xsl:variable name="project" select="umbraco.library:GetXmlNodeById(1070)"/>
    <xsl:variable name="
    projectItems" select="$footer/ancestor-or-self::* [@isDoc and @level = 2]/* [@isDoc and string(umbracoNaviHide) != '1']"/>

    <xsl:if test="count($
    projectItems) &gt; 0">
        <xsl:for-each select="$footerItems">
    <!--to do something-->
        </xsl:for-each>
    </xsl:if>

    But when I visualize xslt I get a message "The XSLT didn't generate any output".

    Could You please help?

  • Ernst Utvik 123 posts 235 karma points
    Aug 31, 2011 @ 20:14
    Ernst Utvik
    0

    Have you declared a $footerItems variable?

    If you want to iterate the child nodes of your project node/variable then just:

    <xsl:for-each select="$project/child::* [@isDoc and umbracoNaviHide != 1]">
  • Alexey Shevchenko 15 posts 34 karma points
    Aug 31, 2011 @ 23:34
    Alexey Shevchenko
    0

    Oh sorry. I was mistaken.

     

    <xsl:variable name="project" select="umbraco.library:GetXmlNodeById(1070)"/>
    <xsl:variable name="
    projectItems" select="$footer/ancestor-or-self::* [@isDoc and @level = 2]/* [@isDoc and string(umbracoNaviHide) != '1']"/>

    <xsl:if test="count($
    projectItems) &gt; 0">
        <xsl:for-each select="$projectItems">
            <!--to do something-->
        </xsl:for-each>
    </xsl:if>

     

  • Alexey Shevchenko 15 posts 34 karma points
    Aug 31, 2011 @ 23:53
    Alexey Shevchenko
    0

    Thanks, Ernst. Your advice was very helpful.

Please Sign in or register to post replies

Write your reply to:

Draft