How can I use variables to define Space properties such as Organisation Name, Product Name, Version?

Shilpa Devi August 3, 2017

Change is always constant and we must adapt to it. Considering that few parameters in our documents change often, I want to define a kind of configurations (name = Value pair) for my space, so that I can change them when required.

For example, if I want the Product name to be a variable, I want to declare the current name and reuse it across the space referring to one location. And when the name changes, I can only modify the Product name in one location and the rest of the document picks it up.

I searched the Community for similar scenarios but did not find an effective solution.

Any help is appreciated.

4 answers

1 accepted

1 vote
Answer accepted
John Corwith
Contributor
August 3, 2017

If you don't need a complex solution, a very basic method would be to create a user macro for your property, and include that macro on all the pages associated with that property. If you update the macro, every page it appears on will be updated. This will require admin priviledges to create and administer these.

## Macro name: propertyversona
## Macro Title: Property Version A
## Macro Body Processing: No macro body
## Visibility: Visible only to system administrators (if you don't want users to see/insert these macros)
## @noparams
## Previous Versions
## 1.0, 1.1

1.2

The above should print out the version (1.2) where ever you include the macro {Property Version A} on a page. Text may wrap around it, I'm not sure (I don't currently have admin access to test.)

bid_msg_76 June 15, 2020

When I understand this way correctly,

a) I need the Sys-Admin-Role to do write that macro?

b) administrating the visibalities of that macro, I can only choose "only Sys-Admins" or "everyone"? I need those macros only for one specific space.

Is there a solution without installing Add-ons?

Thanks!

0 votes
James Tome July 5, 2024

For those looking for solutions on Confluence Cloud.  All the above entries are specific to Data Center.  I have yet to find a solution for CF Cloud, but will reply here if I find something.

Take note Atlassian team, we need a way to define key/value pairs in a space and insert the key (aka variable) as a simple macro when authoring a page that would return the value.  Perhaps a specialized Database content could be used to do this since there's already some interesting work going on there.

0 votes
EPS Software Engineering AG
Contributor
July 7, 2020

Hi @Shilpa Devi 

Another solution could be our App Easy Confluence Variables (ECV). With this app your requirements could probably be implemented as well.

You can find the App Easy Confluence Variables on the Marketplace.

Regards,
Stephan (PM at EPS Software Engineering AG, the vendor of the ECV)

Iskander
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 19, 2021

Hello! This plugin works in the Server version of Confluence. Is there something similar for the Cloud version?

Like # people like this
0 votes
Robert Reiner _smartics_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 3, 2017

The projectdoc Toolbox provides Space Properties to do this.

On the homepage these properties can be defined and used by the Display Space Property Macro. There are also macros that allow placeholder resolvement (for instance in the Transclusion Macro). There are different options to specify these properties (for instance you may attach a properties file to a page).

Using Space Properties provides a tip on how to use this feature.

Using Confluence macros you may use the Excerpt Macro, but this would need to have each property specified on a separate page.

The projectdoc Toolbox is a commerical add-on for Confluence server, available on the Atlassian Marketplace. I'm one of the authors, so my answer may be biased ... :)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events