Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I created related link and display by use XSLT like:
<ul class="footer-menu1" > <xsl:for-each select="$currentPage/ancestor-or-self::* [@isDoc][@level=1]/* [name() = 'navigationRelatedlink' and not(@isDoc)]/links/link"> <li> <xsl:element name="a"> <xsl:if test="./@newwindow = '1'"> <xsl:attribute name="target">_blank</xsl:attribute> </xsl:if> <xsl:choose> <xsl:when test="./@type = 'external'"> <xsl:attribute name="href"> <xsl:value-of select="./@link"/> </xsl:attribute> </xsl:when> <xsl:when test="./@type = 'media'"> <xsl:attribute name="href"> <xsl:value-of select="umbraco.library:GetMedia(./@link, 0)/umbracoFile" /> </xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:attribute name="href"> <xsl:value-of select="umbraco.library:NiceUrl(./@link)"/> </xsl:attribute> </xsl:otherwise> </xsl:choose> <xsl:value-of select="./@title"/> </xsl:element> <!-- Child node of relate link -->
<!-- Child node of relate link --> </li> </xsl:for-each> </ul>
Is there anyway to show that child node of each related link?
Please help me .
Hi,
I'm assuming you'll only show child nodes if the related links is of type "internal" - correct? In that case you can use GetXmlNodeById to get the selected node, and then loop through it's children:
<xsl:if test="@type = 'internal'"> <xsl:variable name="selectedNodeChildren" select="umbraco.library:GetXmlNodeById(@link)/* [@isDoc]" /> <xsl:if test="$selectedNodeChildren"> <ul> <xsl:for-each select="$selectedNodeChildren"> <li> <a href="{umbraco.library:NiceUrl(@id)}"> <xsl:value-of select="@nodeName"/> </a> </li> </xsl:for-each> </ul> </xsl:if></xsl:if>
-Tom
wonderfullllll!!! I can display a child node.
I stuck in this problem for 3 days .
Many thanks Tom :)
is working on a reply...
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
Secondary node of Related Link
I created related link and display by use XSLT like:
<ul class="footer-menu1" >
<xsl:for-each select="$currentPage/ancestor-or-self::* [@isDoc][@level=1]/* [name() = 'navigationRelatedlink' and not(@isDoc)]/links/link">
<li>
<xsl:element name="a">
<xsl:if test="./@newwindow = '1'">
<xsl:attribute name="target">_blank</xsl:attribute>
</xsl:if>
<xsl:choose>
<xsl:when test="./@type = 'external'">
<xsl:attribute name="href">
<xsl:value-of select="./@link"/>
</xsl:attribute>
</xsl:when>
<xsl:when test="./@type = 'media'">
<xsl:attribute name="href">
<xsl:value-of select="umbraco.library:GetMedia(./@link, 0)/umbracoFile" />
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="href">
<xsl:value-of select="umbraco.library:NiceUrl(./@link)"/>
</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="./@title"/>
</xsl:element>
<!-- Child node of relate link -->
#####I want to display all child nodes of each related link ######
<!-- Child node of relate link -->
</li>
</xsl:for-each>
</ul>
Is there anyway to show that child node of each related link?
Please help me .
Hi,
I'm assuming you'll only show child nodes if the related links is of type "internal" - correct? In that case you can use GetXmlNodeById to get the selected node, and then loop through it's children:
-Tom
wonderfullllll!!! I can display a child node.
I stuck in this problem for 3 days .
Many thanks Tom :)
is working on a reply...
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.