Passing a boolean parameter to a javascript function
Hi, this is my first time with xslt and i hope somebody help me figure this one out. I created a macro with a parameter called (alias) "showNavigation", type: bool.
The idea is to pass this parameter to a javascript function which expect a value of 'true' or 'false' but I'm getting a numeric value instead. Here is what I'm doing:
I think you can solve this by making a variable, where you get the correct value and then call it in your function. So the code would look something like this.
Passing a boolean parameter to a javascript function
Hi, this is my first time with xslt and i hope somebody help me figure this one out.
I created a macro with a parameter called (alias) "showNavigation", type: bool.
The idea is to pass this parameter to a javascript function which expect a value of 'true' or 'false' but I'm getting a numeric value instead.
Here is what I'm doing:
Hi
I think you can solve this by making a variable, where you get the correct value and then call it in your function. So the code would look something like this.
<xsl:variable name="showNavigation">
<xsl:choose>
<xsl:when test="/macro/showNavigation = '1'"><xsl:text>true</xsl:text></xsl:when>
<xsl:otherwise><xsl:text>false</xsl:text></xsl:otherwise>
</xsl:choose>
</xsl:variable>
and then in your script you just write <xsl:value-of select="$showNavigation" />
Hope this helps
/Jan
Hi CodeMaster2008
You can do the following:
/Chriztian
i was about to look for how to make an if statment and Jan already gave me the answer. got 2 for the price of one :-)
thanks a lot guys.
You're welcome - as you've already found out by now, the Umbraco community is very responsive and friendly :-)
/Chriztian
is working on a reply...