(n00b question) How to add a condition to for-each select object property
Hey all,
I am an expierenced developer but new to Umbraco this week. I would like to create a xslt macro that grabs objects but uses a property from the objects as a condition.
I have added a property to all datatypes named "topNav" it is of type True/False
I want to create an xslt macro that will grab all objects with that property set on it.
Here are a few things I have tried but I am still learning the syntax:
<xsl:for-each select="$currentPage/descendant::* [@isDoc and string(umbracoNaviHide) != '1' and string(topNav) == '1']">
<xsl:for-each select="$currentPage/descendant::* [@isDoc and string(umbracoNaviHide) != '1' and string(topNav) == 'True']">
<xsl:for-each select="$currentPage/descendant::* [@isDoc and string(umbracoNaviHide) != '1' and $topNav]">
<xsl:for-each select="$currentPage/descendant::* [@isDoc and string(umbracoNaviHide) != '1' and string(topNav) == '1']">
The problem was I was saving objects with that value turned off and they will still displaying but then after saving it said "remember to publish to see changes" and a light went off, I hit save and publish and now it is gone from my nav... as I was wanting.
(n00b question) How to add a condition to for-each select object property
Hey all,
I am an expierenced developer but new to Umbraco this week. I would like to create a xslt macro that grabs objects but uses a property from the objects as a condition.
I have added a property to all datatypes named "topNav" it is of type True/False
I want to create an xslt macro that will grab all objects with that property set on it.
Here are a few things I have tried but I am still learning the syntax:
<xsl:for-each select="$currentPage/descendant::* [@isDoc and string(umbracoNaviHide) != '1' and string(topNav) == '1']">
<xsl:for-each select="$currentPage/descendant::* [@isDoc and string(umbracoNaviHide) != '1' and string(topNav) == 'True']">
<xsl:for-each select="$currentPage/descendant::* [@isDoc and string(umbracoNaviHide) != '1' and $topNav]">
Can anyone point me in the right direction?
Thanks in advance.
well nevermind.... this works:
<xsl:for-each select="$currentPage/descendant::* [@isDoc and string(umbracoNaviHide) != '1' and string(topNav) == '1']">
The problem was I was saving objects with that value turned off and they will still displaying but then after saving it said "remember to publish to see changes" and a light went off, I hit save and publish and now it is gone from my nav... as I was wanting.
looks like you're mostly there. The one thing that might need changing is make the comparision operator "=" instead of "=="
== is not valid XSLT syntax
is working on a reply...