filter on type in navigation
This is an open discussion with 3 replies, filed under XSLT.
Search
I’d love to know this as well, as I was under the impression that the above worked!
Think what you are after is more like this:
<xsl:for-each select="data/navigation/page[not(types/type = 'hidden')]">
Your attempt matches if one of the ‘type’ nodes has a string-value that is not equal to ‘hidden’. My example matches if there does not exist a ‘type’ node which has a string-value equal to ‘hidden’. See the difference in logic?
Comparison operators in XPath checks each node in a node-set separately against a number, string or boolean. In this case each ‘type’ node against the string ‘hidden’.
Thanx froded! Your solution does exactly what’s required
Create an account or sign in to comment.
When I create my navigation with Symphony I want to filter on type: I don’t want to display pages with type=hidden. I use the following XSLT for that and it works:
but… When a page has 2 types (for example, 404 AND hidden), it gets shown in my navigation. I guess it’s because my XML is then like this:
Does anyone know what the correct XSLT is to filter on type=hidden when there are more types available?