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
Need a quick help.
I have a text string called questionHeading, In my xslt I need to hide when this field is empty, I know we need to use the if statement, but not sure how to do it.
<?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:CWS.Twitter="urn:CWS.Twitter" xmlns:umbraco.contour="urn:umbraco.contour" xmlns:PS.XSLTsearch="urn:PS.XSLTsearch" exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets CWS.Twitter umbraco.contour PS.XSLTsearch "><xsl:output method="xml" omit-xml-declaration="yes"/><xsl:param name="currentPage"/><xsl:template match="/"><!-- The fun starts here --><div class="faqs"><xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']"><!-- I NEED TO HIDE THIS CONTENT WHEN UMBRACO FIELD IS EMPTY --><h2><xsl:value-of select="questionHeading"/></h2></xsl:if>
<!-- TILL HERE -->
<h3><xsl:value-of select="question" disable-output-escaping="yes"/></h3><div><p><xsl:value-of select="answer" disable-output-escaping="yes"/></p></div></xsl:for-each></div></xsl:template></xsl:stylesheet>
Hi,
Try this
</xsl:if>
Rich
Thanks Rich!!!
You are my saviour :)
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Want to hide content where the field is empty
Need a quick help.
I have a text string called questionHeading, In my xslt I need to hide when this field is empty, I know we need to use the if statement, but not sure how to do it.
<?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:CWS.Twitter="urn:CWS.Twitter" xmlns:umbraco.contour="urn:umbraco.contour" xmlns:PS.XSLTsearch="urn:PS.XSLTsearch"
exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets CWS.Twitter umbraco.contour PS.XSLTsearch ">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:template match="/">
<!-- The fun starts here -->
<div class="faqs">
<xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']">
<!-- I NEED TO HIDE THIS CONTENT WHEN UMBRACO FIELD IS EMPTY -->
<h2><xsl:value-of select="questionHeading"/></h2>
</xsl:if>
<!-- TILL HERE -->
<h3><xsl:value-of select="question" disable-output-escaping="yes"/></h3>
<div><p><xsl:value-of select="answer" disable-output-escaping="yes"/></p></div>
</xsl:for-each>
</div>
</xsl:template>
</xsl:stylesheet>
Hi,
Try this
</xsl:if>
Rich
Thanks Rich!!!
You are my saviour :)
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.