How can I use variables to define Space properties such as Organisation Name, Product Name, Version?
Asked by Shilpa Devi:

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.


Answers:
author: John Corwith
body: If you don't need a complex solution, a very basic method would be to create a [user macro](https://confluence.atlassian.com/doc/writing-user-macros-4485.html) 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.)

comments: author: bid_msg_76
body: 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!


author: James Tome
body: 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.


author: EPS Software Engineering AG
body: Hi [@Shilpa Devi](/t5/user/viewprofilepage/user-id/1143600)

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](https://marketplace.atlassian.com/apps/1217150/easy-confluence-variables?hosting=server&tab=overview) on the Marketplace.

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

comments: author: Iskander
body: Hello! This plugin works in the Server version of Confluence. Is there something similar for the Cloud version?


author: Robert Reiner _smartics_
body: The [projectdoc Toolbox](https://www.smartics.eu/confluence/x/1YEp) provides [Space Properties](https://www.smartics.eu/confluence/x/jwNk) to do this.

On the homepage these properties can be defined and used by the [Display Space Property Macro](https://www.smartics.eu/confluence/x/AgGyAQ). There are also macros that allow placeholder resolvement (for instance in the [Transclusion Macro](https://www.smartics.eu/confluence/x/_QJk#TransclusionMacro-ApplyDocumentProperties)). There are different options to specify these properties (for instance you may [attach a properties file to a page](https://www.smartics.eu/confluence/x/IAAvAw)).

[Using Space Properties](https://www.smartics.eu/confluence/x/SQNwAg) provides a tip on how to use this feature.

Using Confluence macros you may use the [Excerpt Macro](https://confluence.atlassian.com/doc/excerpt-macro-148062.html), 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](https://marketplace.atlassian.com/1212629). I'm one of the authors, so my answer may be biased ... :)


Tags: content

reuse

variable