Hi, I have a two level navigation menu generated with xslt. The thing is I want to output something different than the child nodes for a given doc type on the first level. The code I have is as follows
If I understand you right, you only want to create the 2nd level navigation when the document type is not a Catalog, am I right?
If thats the case you could probably try to change your if-statement to something like this:
<!-- Sub pages --> <xsl:iftest="count(./node) > 0 and ./@nodeTypeAlias!='Catalog'">
I haven't tested the above code, but when the 1st level node is of the document type 'Catalog' (this name should match the text in the Alias-field on the doc type), there won't be created any 2nd level navigation.
You were right on your second guess about what's my intention. But even with your suggestion the code does not work. It's like the condition is never valid.
Hmm, you have to remember the if-statement. Does the page contain any subnodes at all?
Yout could try debugging a little by just writing something inside the if-statement. Just write some text to see if that is rendered. If it is, you now that it's not the if-sentence that's the problem.
And could you doublecheck that the alias of the Catalog-document type is called "Catalog". Just to be absolutely sure :)
XSLT - Two level navigation issue
Hi, I have a two level navigation menu generated with xslt. The thing is I want to output something different than the child nodes for a given doc type on the first level. The code I have is as follows
where I want to only output a li element when I find a Catalog doc type instead of its childs.
If I understand you right, you only want to create the 2nd level navigation when the document type is not a Catalog, am I right?
If thats the case you could probably try to change your if-statement to something like this:
I haven't tested the above code, but when the 1st level node is of the document type 'Catalog' (this name should match the text in the Alias-field on the doc type), there won't be created any 2nd level navigation.
Hope this works.
/Kim A
Ahh just took another look at your code, and I think I misunderstod the question.
You want to create a <li>-element with "Catalog!!!" inside instead of all the children right?
Try this instead:
/Kim A
Hi Kim,
You were right on your second guess about what's my intention. But even with your suggestion the code does not work. It's like the condition is never valid.
Thanks in advance
Hmm, you have to remember the if-statement. Does the page contain any subnodes at all?
Yout could try debugging a little by just writing something inside the if-statement. Just write some text to see if that is rendered. If it is, you now that it's not the if-sentence that's the problem.
And could you doublecheck that the alias of the Catalog-document type is called "Catalog". Just to be absolutely sure :)
/Kim A
Hi Kim,
Thanks for your help. The problem was in the if-statement like you said.
is working on a reply...