You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
Version 1
Next »
The projectdoc Toolbox makes it easy to search for documents with a given set of constraints in a document tree with a given root.
This tip shows how users of the projectdoc Toolbox can constrain their searches to documents that have a given ancestor page.
Summary
If you need to constrain the search result to documents with a given ancestor, you can take advantage of the artificial properties AncestorNames
and AncestorIds
.
Example
Subtree Search
Suppose you have a Component document "Server" with documents on subcomponents. Now you need to list all documents of type view that are associated with the component or any of its subdocuments.
To limit your search to all documents that have the document named "Server" as their ancestor add
$<AncestorNames>=[Server]
to your where clause.
To filter on the doctype View, you need to append another constraint so that the final where clause looks like this:
$<AncestorNames>=[This Root Page] AND Doctype=view
Search for own Descendants
If you need to list the descendants of a document on that document, you can use the AncestorIds property.This is especially helpful for template authors since the ID is unique, whereas the name might not be.
The projectdoc Toolbox adds the page identifier as artificial property. So the where clause for this search looks like this:
$<AncestorIds> = [${Page ID}]