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.
The following examples can be used with macros that execute searches like the Display Table Macro or the Transclude Documents Macro.
Suppose you have a Component document "Server
" with documents for sub components. Now you need to list all documents of type View that are associated with the component or any of its subordinate documents.
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
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}]