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 a true/false propperty true/false alias "showImage".
How can i test in xsl for it?
something ala:
<xsl:if test=" data [@alias = 'showImage'] = '0' ">
</xsl:if>
Therefore that a true/false property can be unclicked (uninitialized) it is better to test against the true value:
<xsl:if test="data [@alias = 'showImage'] != '1'">...
or for the new schema (4.5):
<xsl:if test="showImage != '1'">...
hth, Thomas
hmmm, i wonder none of it is working, i must do something wrong...
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxml="urn:schemas-microsoft-com:xslt" xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:tagsLib="urn:tagsLib" xmlns:BlogLibrary="urn:BlogLibrary" exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets tagsLib BlogLibrary ">
<xsl:output method="xml" omit-xml-declaration="yes"/><xsl:param name="currentPage"/><xsl:template match="/"><!-- start writing XSLT --><xsl:if test="data [@alias = 'showImage'] != '1'">true...</xsl:if><xsl:if test="showImage != '1'">true again...</xsl:if></xsl:template>
</xsl:stylesheet>
Do you get an error? or is it empty? Which Umbraco Version do you use and if you use 4.5.x which schema do you use, the old one (legacy) or the new one?
Did you check the values? Did you check for typos (it's CaseSensitive).
Cheers, Thomas
its just empty....
i use a 4.xx upgraded to 4.5
i created a propperty with alias: "showImage" type true/false on a tab on my document type...
then i just created a macro "Teaser_ Subpage" and got a Teaser_Subpage.xslt to it.
then i have inserted the macro on my subpage template....
OK, you are working on 4.5. In 4.5 the xml schema changed (see http://our.umbraco.org/wiki/reference/xslt/45-xml-schema).
Please check the UseLegacyXmlSchema setting in the config/UmbracoSettings.config
If it is set to true you are using the old schema. If it is set to false you are using the new schema. be sure that you have republished the content or use the republish described in http://our.umbraco.org/wiki/reference/xslt/mixed-schemas-after-upgrade
If you run the xslt on a page you also have to use the $currentPage param to get the actual node. So the code would be like this:
<xsl:template match="/"><xsl:if test="$currentPage/showImage == '1'">true </xsl:if></xsl:template>
or to check for showImage = false
<xsl:template match="/"><xsl:if test="$currentPage/showImage != '1'">false</xsl:if></xsl:template>
Thanks a lot, that fixed my problems.
Have a great day ;-)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
retreive genereric propperty
I have a true/false propperty true/false alias "showImage".
How can i test in xsl for it?
something ala:
<xsl:if test=" data [@alias = 'showImage'] = '0' ">
</xsl:if>
Therefore that a true/false property can be unclicked (uninitialized) it is better to test against the true value:
or for the new schema (4.5):
hth, Thomas
hmmm, i wonder none of it is working, i must do something wrong...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:tagsLib="urn:tagsLib" xmlns:BlogLibrary="urn:BlogLibrary"
exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets tagsLib BlogLibrary ">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:template match="/">
<!-- start writing XSLT -->
<xsl:if test="data [@alias = 'showImage'] != '1'">
true...
</xsl:if>
<xsl:if test="showImage != '1'">
true again...
</xsl:if>
</xsl:template>
</xsl:stylesheet>
Do you get an error? or is it empty? Which Umbraco Version do you use and if you use 4.5.x which schema do you use, the old one (legacy) or the new one?
Did you check the values? Did you check for typos (it's CaseSensitive).
Cheers, Thomas
its just empty....
i use a 4.xx upgraded to 4.5
i created a propperty with alias: "showImage" type true/false on a tab on my document type...
then i just created a macro "Teaser_ Subpage" and got a Teaser_Subpage.xslt to it.
then i have inserted the macro on my subpage template....
OK, you are working on 4.5. In 4.5 the xml schema changed (see http://our.umbraco.org/wiki/reference/xslt/45-xml-schema).
Please check the UseLegacyXmlSchema setting in the config/UmbracoSettings.config
If it is set to true you are using the old schema. If it is set to false you are using the new schema. be sure that you have republished the content or use the republish described in http://our.umbraco.org/wiki/reference/xslt/mixed-schemas-after-upgrade
If you run the xslt on a page you also have to use the $currentPage param to get the actual node. So the code would be like this:
or to check for showImage = false
hth, Thomas
Thanks a lot, that fixed my problems.
Have a great day ;-)
is working on a reply...