XSLT is a templating language and doesn't handle server-side logic on it's own.
That being said, there are XSLT extensions in Umbraco, like the split function that you've found. You could make your own if you need to do some server sided stuff. But remember, XSLT is really meant to transform an XML file (your umbraco.config file currently) into some other form of angle brackets (HTML in this case).
ASP.Net tags
Hello,
I'm exploring XSLT and umbraco, in my XSLT i need to get my hand on a variable, a property of the usercontrol where i render the xslt macro.
XSLT doesn't seem to like the use of asp tags; <%= GetPropertyX %>
Like this:
<xsl:variable name="mynode" select="$currentPage/ancestor-or-self::root//node[@nodeTypeAlias = 'StartingPoint' and string(./data [@alias = 'StartingPointIDName']) = '<%= GetStartingPointIDName() %>']"/> -- with our without 's
by hardcoding it, the query works:
<xsl:variable name="mynode" select="$currentPage/ancestor-or-self::root//node[@nodeTypeAlias = 'StartingPoint' and string(./data [@alias = 'StartingPointIDName']) = 'testidname']"/>
Is what I'm trying to do here possible?
Further on, i am selecting a page property of type "checkbox list" from the node from the previous query to generate a drop down select list:
This works well:
<xsl:variable name="items" select="umbraco.library:Split($mynode/data[@alias='menuElements'],',')" />
<xsl:for-each select="$items//value">
<option><xsl:value-of select="."/></option>
</xsl:for-each>
Trying to get meaningful text in the dropdown list like this (with asp tags), does not work:
<xsl:variable name="items" select="umbraco.library:Split($mynode/data[@alias='menuElements'],',')" />
<xsl:for-each select="$items//value">
<option><%=GetTextCaption('<xsl:value-of select="."/>') %></option>
</xsl:for-each>
Does anyone know the way to go in this case?
XSLT is a templating language and doesn't handle server-side logic on it's own.
That being said, there are XSLT extensions in Umbraco, like the split function that you've found. You could make your own if you need to do some server sided stuff. But remember, XSLT is really meant to transform an XML file (your umbraco.config file currently) into some other form of angle brackets (HTML in this case).
is working on a reply...