Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Document Properties Marker
doctypetopic
overridefalse


Short DescriptionAlter the rendering of macros of transcluded content with remote controls.
NameRemote Controls for Transclusion
Short Name
Parent
Parent Property
property-nameName
hide
Audience

Name List
doctyperole
render-no-hits-as-blanktrue
render-list-as-comma-separated-valuestrue
namesAuthor, Documentation Architect, Documentation Gardener, Template Author
property-restrict-value-rangetrue
propertyAudience


Subject
Name List
doctypesubject
propertySubject

Categories
Name List
doctypecategory
property-restrict-value-rangetrue
propertyCategories

Tags
Tag List
propertyTags

Flagshide
Iteration

Iteration
valuefilledfinished

hide
Type

Name List
doctypetopic-type
render-no-hits-as-blanktrue
namesTip
property-restrict-value-rangetrue
propertyType


Level of Experience

Name List
doctypeexperience-level
render-no-hits-as-blanktrue
namesCompetent
propertyLevel of Experience


Expected Duration10 mins
Sponsors
Name List
doctypestakeholder
render-no-hits-as-blanktrue
propertySponsors

Sort Keyhide


...

Section
show-titlefalse
titleDescription

This tip shows how to alter the rendering of transluded content by the example of the Display Table Macro based on Remote Controls.

The Remote Controls feature was introduced for the projectdoc Toolbox for Confluence version 4.5.


Section
titleSummary

...

Section
titleTask

Suppose you have pages with references you want to collect and render in a display table.

For this example we use the documentation Online Manual for the projectdoc Toolbox and want to render the name, short description, and referenced documents with the Display Table Macro.

These are the documents we want to transclude from:

  1. Tours
  2. Topics
  3. FAQs

FAQs documentTours documentTopics document


...

Section
titleRequirements

To grab information from these three documents, two requirements must be met:

  1. The table of references is required to be selectable
  2. The display table macros require an identifier of tag

Let's see how we meet this requirements!

Section
titleSelectable Table of References

In our task we want to select the name and short description as properties and the table of references, which is part of the document body. The table of references is part of a Section Macro and therefore selectable. But we do want to have the table alone without the intriduction introduction text.

Therefore the table is needs to be wrapped inside a Content Marker Macro with identifier documents (the identifier may be any character sequence).

Content Marker Macro with Identifier Parameter set to 'documents'.

Since the Display Table Macro renders each property and section in a column identified by the name or title – in our case identifier – we need to make sure that the identifier provided to the Identifier Parameter of teh the Content Marker Macro has the same value in all three documents.


Section
titleSelectable Display Table Macro

In order to remote control the Display Table Macro the macro requires to be identifiable. This can be done by either providing a value to the Identifier Parameter or the Identifier Classes Parameter.

We decide to provide the identifier references.

The Identifier Parameter of the Display Table Macro is set to 'references'.


...

Section
titleTransclusion and Remote Controls

Using a Display Table Macro to render the name, short description and documents property has per default the following result:

Result of the Display Table Macro

We use Name, Short Description, documents for the Select Parameter and translate documents to References (documents=References) by the use of the Header Translations Parameter.

The problem is that the documents are rendered differently in the three locations. In this view we need to have a unified format. The unified format should only render the name and short description. We also want – since the value is rendered in a table cell – the list of references be rendered as a definition list and not as tables.

We use the Remote Control feature and are able to control all three transcluded macros by the use of the identifier references (as we have shown in the Requirements section above).

We set the Remote Controls Parameter to 

Code Block
languagetext
references:select=Name, Short Description&references:render-mode=definition

What does this mean?

references is the identifier of the macros we want to remote control. We set the Select parameter to Name, Short  Description. Not only do we want to have each cell render the same properties, but also a definition list is only rendered in case there are only two properties selected.

The second control is adjusting the Render Mode to definition, which will render the table as a definition list.

So this is the result:

The Display Table with normalized References Column

In case you want to collapse the Name and Short Description colums columns, use a Template as a value for the Select Parameter.

Code Block
languagetext
#T\{$[Name]<br/>${Short Description}\}, documents

Note the backslashes (\). They are necessary because of an issue with the macro editor. It has difficulties parsing values with curly braces. The backslash escapes it properly, so the macro editor will close successfully.

We also need to translate the name of the template T to Name. So the Header Translations read like this:

Code Block
languagetext
documents=References, T=Name

So this is the result (only the first row shown):

Result of using a Template to render Name and Short Description in one Column


Section
titleConclusion

We have shown how the result of a Display Table Macro can be rendered more concise.

By the use of Remote Controls we turned tables in different format into a definition list. By the use of a Select Template we collapsed the first two columns into one.

The focus of this tip is on using Remote Controls. It requires some configuration on the part of the transcluded content. The use of transclusion should be already considered when designing the information architecture. But – if the user has write access to all transcluded content – we have shown that adjusting the content is not too difficult.


Section
ignore-template-buttonstrue
titleSubordinate Topics


Hide From Reader

Create from template
blueprintModuleCompleteKeyde.smartics.atlassian.confluence.smartics-projectdoc-confluence-space-core:projectdoc-blueprint-doctype-topic
buttonLabelCreate Topic

Display Table
doctypetopic
render-no-hits-as-blanktrue
render-modedefinition
selectName, Short Description
restrict-to-immediate-childrentrue
sort-bySort Key, Name

...

Section
titleResources


Tour
render-no-hits-as-blanktrue
render-as-definition-listtrue
marker-column-property-nameTitle
replace-title-with-nametrue





Piwik Set Multiple Custom Variables


NameValue
Departmentprojectdoc
Categoryprojectdoc-tip
Typehowto


...