I have a multilangual website setup, in which the xslt checks for the current language by getting the name of the rootnode. It then has to append the current language to a property alias. I've tried to do it with concat, but it gives me text instead of a value.
So, I have a $lang and a value for $node/prodDescription and I want the the complete string to be:
Combine strings?
I have a multilangual website setup, in which the xslt checks for the current language by getting the name of the rootnode. It then has to append the current language to a property alias. I've tried to do it with concat, but it gives me text instead of a value.
So, I have a $lang and a value for $node/prodDescription and I want the the complete string to be:
<xsl:value-of select="$node/prodDescription_NL"/>
Is that possible?
Some explanation:
<xsl:template match="/"> <xsl:variable name="lang" select="$currentPage/ancestor-or-self::*[@level = '2']/@nodeName"/> <xsl:value-of select="$lang"/> <xsl:if test="$currentPage/products/MultiNodePicker/nodeId"> <xsl:for-each select="$currentPage/products/MultiNodePicker/nodeId"> <xsl:variable name="node" select="umbraco.library:GetXmlNodeById(.)" /> <div class="dealer"> <h3> <xsl:value-of select="$node/pageTitle"/> </h3> </div> </xsl:for-each> </xsl:if> </xsl:template>You can use concat, you just need to do the following to access the field:
<xsl:variable name="propertyAlias" select="concat('prodDescription_',$lang)"/>
<xsl:value-of select="$node/* [not(@isDoc)][name() = $propertyAlias]"/>
Not tested but should work..
-Tom
[EDIT]
... Too slow :-)
/Chriztian
Tom and Chriztian,
Exactly what I was looking for!
Thanks!
Ralph
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.