projectdoc Toolbox

It is easy to list all pages that transclude a section from the current page. This allows you, as an author, to check quickly if changes to a document that is transcluded, needs changes to the transcluding documents.

Expected Duration
10 min
Tags
Type

If you apply changes to a document you may like to know which documents transclude content from this document. This way you are able to check quickly, if your changes call for changes in some of the transcluding documents.

Explicit Transclusions are supported

 

Only explicit transclusions are tracked with this approach. Explicit transclusions are set with the Transclusion Macro. These transclusions are evaluated at the time the page is saved.

If you employ searches for your transclusion, the references are not tracked. Searches are evaluated at the time the search is executed. Therefore transclusions rendered with the Transclude Documents Macro will not show up in this list.

This is similar to the fact that links rendered within the Display Table Macro are also not counting as references to the page.

Using the projectdoc Toolbox makes this very easy. Actually some doctypes, such as the Module, automatically add this information.

Use a constraint on the search result like this:

$<TranscludedDocumentTitles>=[${Space Key}.${Name}]

Here is the code in storage format to add in order to list the transcluding pages:

<ac:structured-macro ac:name="projectdoc-display-table">
  <ac:parameter ac:name="render-no-hits-as-blank">true</ac:parameter>
  <ac:parameter ac:name="select">Name, Short Description, Doctype</ac:parameter>
  <ac:parameter ac:name="sort-by">Sort Key, Name</ac:parameter>
  <ac:parameter ac:name="where">$&lt;TranscludedDocumentTitles&gt;=[${Space Key}.${Name}]</ac:parameter>
</ac:structured-macro>
 

If you want to show the transclusion information only to authors, you may hide the section dependent on user privileges. See Information for Audiences for details.

Resources

These macros transclude content from a projectdoc document:

These macros define content to be transcluded:

  • Section Macro - Renders a section, if the body is not empty. Supports authors to create content, clutter-free rendering without empty sections. Allows to transclude the content.
  • Content Marker Macro - Marks a piece of content within a document. This content can be referenced for transclusion.

More information on transclusion topics are found by the tag Transclusion.