You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 10
Next »
A collection of macros supports dynamic parameters that may be controlled remotely or by their context. This tip provides some information on context controlled macros.
Summary
To use context controlled macros you need to provide
- an identifier and
- check the checkbox parameter Context controlled.
Add a property with format identifier:parameter-name
to the context.
Macros
The following macros support dynamic properties to be controlled by the context they are in.
- Display List Macro
- Lists references to projectdoc documents in a list. List contain names and optional short descriptions.
- Display List Template Macro
- Lists references to projectdoc documents in a list. List items are defined by templates referencing properties.
- Display Table Macro
- Lists references to projectdoc documents in a table. Allows to select document properties for columns. Also non-list representations are provided.
- Index Entries Table Macro
- Renders a table of index entries.
- Tour-by-Property Macro
- Renders a predefined list of documents in a table . Documents are selected by a document property. Allows to select document properties for columns. Also non-list representations are provided.
- Transclude Documents Macro
- Renders transcluded content fetched from documents of a result set.
- Transclusion Macro
- Transcludes content from a document marked with the content marker macro.
- Transclusion Reference Macro
- Transcludes content via a reference from a document marked with the content marker macro.
- Transclusion to Text Macro
- Transcludes content from a document marked with the content marker macro and renders it as plain text.
A macro is in the context of
- its document,
- the parent documents (up to the root),
- the space the document is part of and
- all spaces in the delegate closure (using the delegate-space property) of that space.
Templates
To control the parameters with the context, the macro is required to provide a unique identifier.
The feature must be activated. Otherwise the context is not taken into account.
Override Parameter
The parameter's name can be quickly fetched with the inspect context menu item provided by your browser.
Use the part after the prefix "macro-param-
", such as "select
" in the example above.
The name of the parameters that are actually supported are documented with the macro. For the Display Table Macro they are listed with the section Remote Controlled Documents.
Construct the name of the property to override the parameter value like this:
<Macro Identifier> + ':' + <Parameter Name>
For the example above this would read:
Example
In this example we use the Display Table Macro to list documents that describe doctypes.
Basic Configuration
The macro editor shows the Display Table Macro querying for documents of document type 'doctype'. The table columns show the name and the short description for each hit.
Context Awareness
To make the macro context aware, we provide an identifier and activate the Context controlled checkbox.
Controlled by Property
Now add the property to the document that contains the macro.
Result
The table will now be rendered with columns Name, ID, Set, and Short Description.