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
Hi
I'm trying to loop all nodes by a document type in xslt.I have come across this a few times in the forum but nothings working for me.
My documents could be anywhere in the system and as far as I can gather this should work:
<xsl:for-each select="umbraco.library:GetXmlAll()//node [@nodeTypeAlias='prop'] ">
But it doesn't.
Can I even do what I am trying to do?
Are you using the new XML schema? Your example above looks like it's referencing the old schema.
If using the new schema instead try:
<xsl:for-each select="umbraco.library:GetXmlAll()//prop [@isDoc] ">
Not sure if this is the most efficient way but should work
-Tom
I've got the latest version of umbraco so it's what ever the lastest schema is.. I know it changed at some point but am unsure when.
Can you think of another way of doing this?
You should be using the new schema then. Did you try the above code? Is 'prop' the alias of the Document Type you are looking for?
You could also try: $currentPage/ancestor::root//prop [@isDoc]
Yes.. the above code works well! You just mentioned that possible not efficient !
Prop is the documenttype.
Will this find the files in the recycling bin as I know this has been a problem in the past?
Not sure about GetXmlAll, but the second snippet I pasted shouldn't show items in the recycle bin. If it does you could add a check, something like: ...//prop [@isDoc][not(contains(@path, '-20,'))] but I don't think it will be an issue.
Thanks for your help :)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Get all Nodes By DocumentType
Hi
I'm trying to loop all nodes by a document type in xslt.
I have come across this a few times in the forum but nothings working for me.
My documents could be anywhere in the system and as far as I can gather this should work:
<xsl:for-each select="umbraco.library:GetXmlAll()//node [@nodeTypeAlias='prop'] ">
But it doesn't.
Can I even do what I am trying to do?
Are you using the new XML schema? Your example above looks like it's referencing the old schema.
If using the new schema instead try:
Not sure if this is the most efficient way but should work
-Tom
I've got the latest version of umbraco so it's what ever the lastest schema is.. I know it changed at some point but am unsure when.
Can you think of another way of doing this?
You should be using the new schema then. Did you try the above code? Is 'prop' the alias of the Document Type you are looking for?
You could also try: $currentPage/ancestor::root//prop [@isDoc]
-Tom
Yes.. the above code works well! You just mentioned that possible not efficient !
Prop is the documenttype.
Will this find the files in the recycling bin as I know this has been a problem in the past?
Not sure about GetXmlAll, but the second snippet I pasted shouldn't show items in the recycle bin. If it does you could add a check, something like: ...//prop [@isDoc][not(contains(@path, '-20,'))] but I don't think it will be an issue.
-Tom
Thanks for your help :)
is working on a reply...