You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
Version 1
Next »
Keeping track of transclusions using artificial properties.
Transclusions
A transclusion is the act of fetching content from one Confluence page and render it in another page. The content from the page is transcluded. The page rendering the foreign content is the transcluding page. This practice supports content reuse. In its purest form the documentation consists of a vast collection of modules where each piece of information addresses only one single topic. For tutorials or other types of documents where the author addresses a complex subject, the topics are elegantly composed to form a new whole.
The projectdoc Toolbox supports transclusions by a number of macros including the Transclusion Macro (transclude one or more sections from one document) and the Transclude Documents Macro (transclude one or more sections from multiple documents). The first macro references one document explicitly, while the second macro conducts a search to find a set of documents from which the sections are transcluded. Hard references are stored in an artificial property by the name of TranscludedDocumentTitles. Searches do not create hard references since the result of the search is based on the state of the documentation at request time. When documents are added, removed, or updated, the same query may have a different result set of documents.
Listing who Transcludes
The Module doctype provides a section named Transcluded by
.
This section lists all documents that transclude contents from this module.
The Where clause reads:
$<TranscludedDocumentTitles>=[${Space Key}.${Title}]
The query selects all documents that contain the space key and title (in a special format SpaceKey.PageTitle
) in their list of pages they transclude from.
Listing what is transcluded
With version 3.0.3 of the projectdoc Toolbox a new artificial property named Page Key
will be provided. This page key has the form SpaceKey.PageTitle
. It allows to uniquely reference a page within a Confluence server as does the numerical page ID. While page IDs may change, for instance due to export and import of a space, the tupel space key and page title does not. The page key is controlled by the user, while the page ID is not.
With this new artificial property the following query can be specified.
$<Page Key>~(${TranscludedDocumentTitles})
It searches all pages whose page key is part of the current document's transclusion list.