Versions Compared

Key

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


Section


Column


Document Properties Marker
doctypetopic
overridefalse


Short DescriptionShows how to render the value of a document property with a display macro. There are actually three variants of this macro that we are discussion in this short article.
NameReferencing Property Values
Short Name
Parent
Parent Property
property-nameName
hide
Audience

Name List
doctyperole
render-no-hits-as-blanktrue
namesAuthor, Template Author
property-restrict-value-rangetrue
propertyAudience
empty-as-nonetrue


Subject
Name List
doctypesubject
propertySubject

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

Tags
Tag List
propertyTags

Flagshide
Iteration

Iteration
valuereleased

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
namesAdvanced Beginner
propertyLevel of Experience


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

Sort Keyhide




Column


Panel
titleContents

Table of Contents
maxLevel1
indent10px
excludeReferences|Resources
stylenone




Section
show-titlefalse
titleDescription

The Display Property Macros allow to reference another projectdoc document another 

Static Document Link
documentprojectdoc Document
and display on of its
projectdoc-static-document-link-macro
documentPDAC:Document Property
labeldocument properties
. The simplest version of these macros is the
Static Document Link
documentDisplay Document Property Macro
which will render a single value. There are more members in this family and this .

This short article introduces this macro a simple macro for displaying property values and two of its siblings.


Section
titlePrerequisites


...

Section
titleSimple Use Case: Display a Property Value

The

Static Document Link
documentDisplay Document Property Macro
allows to add a static link to a Confluence page and, in case the page is a projectdoc documentDocument, allows to select a property name to render the value for that property.

Example Box
titleRender a Property Value

Suppose there is a document for an organization named Green Documentation Organization.

To render the organization's website, use the Display Document Property Macro like this:

The property value is rendered as a link since the value is actually a link pointing to https://greendocs4u.eu/.

Do not click the Add Link checkbox! 

The macro will even not allow to override the link address so that the link https://greendocs4u.eu/ does point to https://greendocs4u.eu/


Example Box
titleRender a Property Value with Link

This macro parameter Add Link is useful if there should be a link to the document. For instance if you add a Short Name property to the organization.

In this case do add a link! Note that there is also the short description rendered as a tooltip.


...

Section
titleDisplay Property from a referenced Document

The use case for the 

Static Document Link
documentDisplay Document Property Ref Macro
is a little more complex. It allows you to specify a document where a property references another document which provides a property you want to render. Seems complicated? Well, let's look at an example!

Example Box
titleRendering a Property from a referenced Document

Suppose you add a person document for Gabriella Green. The idea is that every person working for an organization should have the organization's website as default.

So this is the new version of the organization document:

And this is the document for Gabriella Green:

While the email address is for Gabriella personally, the website of the organization is rendered for her website.

Here is the Display Document Property Ref Macro in the macro editor:

Image Added

Because Documents is empty the macro points to the Organization property in the same document. Following the link to the organization, the macro picks the value of the organization's Website property.

In And in case the website for the organization changes, the change will be applied automatically to the Website property of Gabriella's document.


...

Section
titleConcatenate Properties from two different Documents

The use case for the 

Static Document Link
documentDisplay Document Property Ref Concat Macro
is only one small step further. It allows to fetch two property values from two different documents and render them together. Is there actually a use case for this macro? Here is the example:

Example Box
titleRendering two Property Values from two Documents

For this use case we add a telephone number to get in touch with the Green Documentation Organization.

The Phone Stem property provides the base phone number where employees add their extension number. For Gabriella this looks like this:

The configuration of the Display Document Property Ref Concat Macro in the macro editor looks like this:

The rendered document of Gabriella:

Both properties, Phone and Website, use the Organization reference to fetch information Phone Stem and the Website from the organization.


...