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
Sorry I know this is going to be a simple one - But I need to get all nodes by a specific template where ever they are within the tree. any chance of a syntax example
Is it by doctype or by template selected?
doctype:
$currentPage/ancestor-or-self::node [@nodeTypeAlias = 'yourdoctype alias']
template:
$currentPage/ancestor-or-self::node [@template = 'template id']
$currentPage/ancestor-or-self::node//node [@template = 'template id']
you may need to go to the top of the tree and traverse back down, as above.
Perfect - Thanks Chris, it was the syntax to go up and back down that I couldn't get right.
Very appreciated, thanks
Indeed if you need the nodes from within the current tree, use Chris' solution.
If you need to restrict the location from where your selection should start, add a level restrictment
$currentPage/ancestor-or-self::node [@level=1]//node [@template = 'template id']
awesome thanks :)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Get All Nodes With Specific Template
Sorry I know this is going to be a simple one - But I need to get all nodes by a specific template where ever they are within the tree. any chance of a syntax example
Is it by doctype or by template selected?
doctype:
template:
you may need to go to the top of the tree and traverse back down, as above.
Perfect - Thanks Chris, it was the syntax to go up and back down that I couldn't get right.
Very appreciated, thanks
Indeed if you need the nodes from within the current tree, use Chris' solution.
If you need to restrict the location from where your selection should start, add a level restrictment
awesome thanks :)
is working on a reply...