Copied to clipboard

Flag this post as spam?

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


  • Dan 1250 posts 3747 karma points admin c-trib
    Jul 06, 2010 @ 13:11
    Dan
    0

    List whole structure from changeable source

    Hi,

    I'm trying to list the whole site structure from a changeable source, but it's currently not returning anything.  Can anyone see what's wrong with the following XSLT:

    <xsl:param name="currentPage"/>
    <!--xsl:variable name="source" select="/macro/source" /-->
    <xsl:variable name="source" select="4444" />

    <xsl:template match="/">
    <xsl:call-template name="drawNodes">
    <xsl:with-param name="parent" select="umbraco.library:GetXmlNodeById($source)" />
    </xsl:call-template>
    </xsl:template>

    <xsl:template name="drawNodes">
    <xsl:param name="parent" />
    <ul>
    <xsl:for-each select="$parent/node">
    <li>
    <xsl:value-of select="@nodeName" />
    <xsl:if test="count(./node) &gt; 0">
    <xsl:call-template name="drawNodes">
    <xsl:with-param name="parent" select="." />
    </xsl:call-template>
    </xsl:if>
    </li>
    </xsl:for-each>
    </ul>
    </xsl:template>

    (I'm hard coding the source node id to eliminate that from enquiries!)

    Old schema, 4.0.1, by the way.

    Thanks all.

  • Lee Kelleher 3945 posts 15163 karma points MVP 10x admin c-trib
    Jul 06, 2010 @ 13:22
    Lee Kelleher
    0

    Hi Dan,

    I'd take a look at the XML for node '4444' ... to check if there are any child <node>s?

    The rest of the XSLT looks fine to me.

    Cheers, Lee.

  • Dan 1250 posts 3747 karma points admin c-trib
    Jul 06, 2010 @ 13:30
    Dan
    0

    Ah, that was a weird one.  Definitely nodes under 4444, and I tried other nodes too, but nothing.  Republished the whole site and bingo.

    Thanks Lee!

  • 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