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
I have been trying to create a general XSLT to display all the content of the datatype by passing in the name of the field it uses in umbraco but so far it isn't displaying anything.
I don't really know what to do with this, i can pass in the name, i can pass in a field of a different datatype but i can't seem to pass in this data type and have the foreach loop run through all the parts of this field. what is wrong with this?
<umbraco:Macro Field="[#list1]" Alias="CheckLists" runat="server"></umbraco:Macro>
<umbraco:Macro Field="[#list2]" Alias="CheckLists" runat="server"></umbraco:Macro>
<xsl:param name="ListField" select="/macro/Field"/>
<p><xsl:value-of select="listitem" /></p>
and i do know that this foreach code WILL display the list items:
but that doesn't help when i have multiple embedded content fields on a single page and i want to just use one macro to display them all.
To access an element by name (when you don't know the name beforehand) you can use the name() function:
<xsl:for-each select="$currentPage/*[name() = $ListField]/data/item">
that works perfectly, just had to change the macro from accepting the field to accepting the field name, thank you :D
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted