This works but is static: <xsl:variable name="farve_1" select="umbraco.library:GetDictionaryItem('Red')"/> <!-- Gives me 'Rød' -->
Now i am trying to dynamically parse the correct lookup string into my GetDictionaryItem xsml. But am getting nothing in return. Do i need to change the data type of my variable? Below is my testing so far.
<xsl:variable name="farve_2" select=".//fields/flowercolor//value"/> <!-- Gives me '#Red' --> <xsl:variable name="farve_3" select="umbraco.library:GetDictionaryItem('$farve_2')"/> <!-- Gives me '' --> <xsl:variable name="farve_4" select="translate($farve_2, '#','')"/> <!-- Gives me 'Red' --> <xsl:variable name="farve_5" select="umbraco.library:GetDictionaryItem('$farve_4')"/> <!-- Gives me '' -->
How to use GetDictionaryItem with variable
This works but is static: <xsl:variable name="farve_1" select="umbraco.library:GetDictionaryItem('Red')"/> <!-- Gives me 'Rød' -->
Now i am trying to dynamically parse the correct lookup string into my GetDictionaryItem xsml. But am getting nothing in return. Do i need to change the data type of my variable? Below is my testing so far.
<xsl:variable name="farve_2" select=".//fields/flowercolor//value"/> <!-- Gives me '#Red' -->
<xsl:variable name="farve_3" select="umbraco.library:GetDictionaryItem('$farve_2')"/> <!-- Gives me '' -->
<xsl:variable name="farve_4" select="translate($farve_2, '#','')"/> <!-- Gives me 'Red' -->
<xsl:variable name="farve_5" select="umbraco.library:GetDictionaryItem('$farve_4')"/> <!-- Gives me '' -->
Thanks
Hi,
Try removing the ' in the last one. Like this:
/Peter
Thanks Peter :-)
<xsl:variable name="farve_1" select=".//fields/flowercolor//value"/> <!-- Gives me '#Red' -->
<xsl:variable name="farve_2" select="translate($farve_1, '#','')"/> <!-- Gives me 'Red' -->
<xsl:variable name="farve_3" select="umbraco.library:GetDictionaryItem($farve_2)"/> <!-- Gives me 'Rød' -->
I ended up doing it like this:
<xsl:variable name="farve_1" select="umbraco.library:GetDictionaryItem(translate(.//fields/flowercolor//value, '#',''))"/><!-- Gives me 'Rød' -->
Yep... That was what I would say next to do :-)
is working on a reply...