Dynamically I get the languageCode (e.g. nl or en or us) and put this in a variable. After that I want to use this variable as a property from a media item.
Instead of $media/umbracoFile I need $media/nl or $media/en or $media/uk depending on the languageCode.
How to add variable as element
Dynamically I get the languageCode (e.g. nl or en or us) and put this in a variable. After that I want to use this variable as a property from a media item.
Instead of $media/umbracoFile I need $media/nl or $media/en or $media/uk depending on the languageCode.
I tried a lot of things but nothing works.
Here's my code:
<xsl:variable name="language" select="$currentPage/ancestor-or-self::Home[@isDoc]" />
<xsl:variable name="languageCode" select="$language/language" />
<xsl:for-each select="$currentPage/productDownloads/MultiNodePicker/nodeId">
<xsl:variable name="media" select="umbraco.library:GetMedia(., false())" />
<li>
<a href="{$media/umbracoFile}" target="_blank">
<xsl:value-of select="$media/[$languageCode]" />
</a>
</li>
</xsl:for-each>
Could someone help me?
Hi Sander,
You do that using the name() function:
/Chriztian
Problem was the UPPERCASE of the variable languageCode :-(.
Now it works!
is working on a reply...