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
value

facade

released

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
width50%


Panel
titleContents

Table of Contents
maxLevel1
outlinetrue
indent10px
excludeReferences|Resources
stylenone




Section
show-titlefalse
titleDescription

The Display Property Macros allow to reference another 

Static Document Link
documentprojectdoc Document
and display on of its
Static Document Link
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.

This short article introduces 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 link to a Confluence page and, in case the page is a projectdoc Document, 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.

Image Added

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

Image Added

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! 

Image Added

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


projectdoc-box-example
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.

Image Added

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

Image Added



projectdoc-section
Summary
titleDisplay Property Value 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:

Image Added

And this is the document for Gabriella Green:

Image Added

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 case the website for the organization changes, the change will be applied automatically to the Website property of Gabriella's document.


Note Box
titleIssue with the Documents Parameter

Due to an issue with the Documents parameter, there is no autocomplete. See

Jira
serversmartics JIRA
serverId79ad43bc-d289-364e-bfc7-46c09847bebd
keyPDAC-1543
for details



Section
titlePrerequisitesConcatenate Property Values 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.

Image Added

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

Image Added

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

Image Added

The rendered document of Gabriella:

Image Added

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



Use case
Section
titleSummary

In this tip we managed to render a property from a document. 

First the

Static Document Link
documentDisplay Document Property Macro
simply renders a property from the referenced document.

Then the

Static Document Link
documentDisplay Document Property Ref Macro
allows to render a property value from a document that is referenced by a property. In our case this property was a property of the local document (the document with the macro). And this is the typical use case.

Finally the

Static Document Link
documentDisplay Document Property Ref Concat Macro
allows to render two property values from two different documents. While the use case may seem a bit abstract, the macro is actually quite handy for concatenating values. Again the typical use case is that one property value is on the local document.

Section
title


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
required-permissionswrite-access
titleNotes


Section
titleReferences

The following topics are discussed in this article.

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





Section
titleResources

Here are more resources related to the topic of this article.

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


...