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,
I have setup a class for xslt extension methods and have got everything working. How do I return a simple boolean value to my xslt template now?
e.g.
public class UmbracoExtensionMethods {
public static bool IsAllowed(){ return true; }
}
So I can use this method in my xslt like this:
<xsl:if test="myExtensions:IsAllowed()">
Andrew,
I will make the extension as you do, and in xslt use
string(myExtensions:IsAllowed())=='1'
Martin
Or even better:
boolean(myExtensions:IsAllowed())
Hi Andrew,
You can also use test="boolean(myExtensions:IsAllowed())"
Ron
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Return bool from xslt extension method
Hi,
I have setup a class for xslt extension methods and have got everything working. How do I return a simple boolean value to my xslt template now?
e.g.
So I can use this method in my xslt like this:
Andrew,
I will make the extension as you do, and in xslt use
string(myExtensions:IsAllowed())=='1'
Martin
Or even better:
boolean(myExtensions:IsAllowed())
Hi Andrew,
You can also use test="boolean(myExtensions:IsAllowed())"
Ron
is working on a reply...