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
Hi all,
I have a macro which has a parameter using propertyTypePicker with an alias of option1. The option selected within the picker is cmsWebsite
Within my xslt I want to use this parameter to display the value of cmsWebsite. Sounds simple enough doesn't it.
So within my xslt I have set up a variable:
<xsl:variable name="opt1" select="/macro/option1"/>
<xsl:for-each select="umbraco.library:GetXmlNodeById(XXX)/* [@isDoc and string(umbracoNaviHide) != '1']">
<xsl-value-of select="$opt1" /> //Prints out the words option1
<xsl-value-of select="cmsWebsite" /> //Works - prints out the web address (test to see that it does work)
<xsl:value-of select="umbraco.library:GetItem(@id, $opt1)"/> //returns blank<xsl:value-of select="umbraco.library:GetItem($opt1)"/> //returns blank
<xsl:value-of select="umbraco.library:GetXmlNodeById(XXX)/$opt1" /> //breaks the xslt and causes the page to macro to error if errors are ignored.
</xsl:for-each>
I would really appreciate it if anyone could put me in the right direction.
Thanks
Chris
<xsl-value-of select="$opt1" /> //prints out cmsWebsite not option1. Sorry
In case anyone else is having the same problem the following code is all you need:
<xsl-value-of select="umbraco.library:GetXmlNodeById(XXX)/*[name() = $opt1]" />
ThanksChris
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
Return property value based on variable
Hi all,
I have a macro which has a parameter using propertyTypePicker with an alias of option1. The option selected within the picker is cmsWebsite
Within my xslt I want to use this parameter to display the value of cmsWebsite. Sounds simple enough doesn't it.
So within my xslt I have set up a variable:
<xsl:variable name="opt1" select="/macro/option1"/>
<xsl:for-each select="umbraco.library:GetXmlNodeById(XXX)/* [@isDoc and string(umbracoNaviHide) != '1']">
<xsl-value-of select="$opt1" /> //Prints out the words option1
<xsl-value-of select="cmsWebsite" /> //Works - prints out the web address (test to see that it does work)
<xsl:value-of select="umbraco.library:GetItem(@id, $opt1)"/> //returns blank
<xsl:value-of select="umbraco.library:GetItem($opt1)"/> //returns blank
<xsl:value-of select="umbraco.library:GetXmlNodeById(XXX)/$opt1" /> //breaks the xslt and causes the page to macro to error if errors are ignored.
</xsl:for-each>
I would really appreciate it if anyone could put me in the right direction.
Thanks
Chris
<xsl-value-of select="$opt1" /> //prints out cmsWebsite not option1. Sorry
In case anyone else is having the same problem the following code is all you need:
<xsl-value-of select="umbraco.library:GetXmlNodeById(XXX)/*[name() = $opt1]" />
Thanks
Chris
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.