In my site I need to load the related links property recursive. This hasn't been a problem with simple datatypes, but the related links just doesn't want to work recursive.
I wonder if anyone has any experience with getting this to work? On the old forums the only suggestion was to use the property of the lvl 1 document by default but that just doesn't work for my setup. i need the real recursion :) Any ideas?
I have the same problem in 4.6.1. I am creating several lists of links in my master template that need to be inherited sitewide. They show up on the first child template and stop there. I've tried above and no go. Any suggestions?
<xsl:param name="currentPage"/> <!-- Input the related links property alias here --> <xsl:variable name="propertyAlias" select="string('maalgrupper')"/> <xsl:template match="/">
Related Links Recursive
In my site I need to load the related links property recursive. This hasn't been a problem with simple datatypes, but the related links just doesn't want to work recursive.
I wonder if anyone has any experience with getting this to work? On the old forums the only suggestion was to use the property of the lvl 1 document by default but that just doesn't work for my setup. i need the real recursion :) Any ideas?
The solution:
I am trying to port this to the 4.5.x xml schema, but I can't get it to work.
Here is the changed foreach part:
<xsl:for-each select="$currentPage/ancestor-or-self::* [name() = $propertyAlias and not(@isDoc)]/links/link">
What am i doing wrong?
Works for me (rl is my propertyname...testsite ;) ) :
Thanks, it's working in 4.5.2 for me.
I have the same problem in 4.6.1. I am creating several lists of links in my master template that need to be inherited sitewide. They show up on the first child template and stop there. I've tried above and no go. Any suggestions?
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " ">]>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets"
exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">
<xsl:output method="xml" omit-xml-declaration="yes" />
<xsl:param name="currentPage"/>
<!-- Input the related links property alias here -->
<xsl:variable name="propertyAlias" select="string('maalgrupper')"/>
<xsl:template match="/">
<!-- The fun starts here -->
<ul>
<xsl:for-each select="$currentPage/* [name() = $propertyAlias 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: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>
</li>
</xsl:for-each>
</ul>
<!-- Live Editing support for related links. -->
<xsl:value-of select="umbraco.library:Item($currentPage/@id,$propertyAlias,'')" />
</xsl:template>
</xsl:stylesheet>
is working on a reply...