You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

projectdoc Toolbox

Shows 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.

Audience
Type
Level of Experience

The Display Property Macros allow to reference another projectdoc document and display on of its document properties. The simplest version of these macros is the Display Document Property Macro which will render a single value. There are more members in this family and this short article introduces this macro and two of its siblings.

Simple Use Case: Display a Property Value

The Display Document Property Macro allows to add a static 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.

Render 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/

Display Property from a referenced Document

The use case for the Display 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!

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

Concatenate Properties from two different Documents

The use case for the Display 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:

Rendering 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.

References

Display Document Property Macro
Renders the value of a property of a document.
Display Document Property Ref Macro
Displays a document property from a referenced document.
Display Document Property Ref Concat Macro
Displays a single property of a document that is referred by a property of another document and concatenates it with the value of a local property.
Display Document Properties Macro
Renders a template with property references.
Display Document Property As Image Macro
Renders the value of a document property as an image. The property value is required to an URL that points to an image.
Display Document Property As Link Macro
Renders the value of a document property as a link with an alternative label.
Display Document Property As List Macro
Renders the list value of a document property.
Parent Property Macro
Renders the property of the parent document, if it has the same doctype.
Display Space Property Macro
Renders a space property value.
Display Space Attribute Macro
Renders a space attribute value.

Resources

Parent Property of projectdoc Documents
projectdoc documents typically provide a property named 'Parent Property'. This property refers to a logical parent. This tip shows what this is all about.
Linking to Glossary Terms
Show how to use the Name List Macro to render links to glossary terms.
Use Display Properties Macro for List Items
If you want to list a reference to a document with name and short description, use the Display Properties Macro. If you specify no property names, it defaults to Name and Short Description.

  • No labels