Variables in confluence Text
Asked by Fabian Arndt:

Hello,

is there a easy way to define certain variables. like $comanyname=mycompany and use them confuence or space wide?

We wish to sync some pages between multiple company's and that would be a handy feature.


Answers:
author: James Tome
body: For those looking for solutions on Confluence Cloud, the entries in this thread and those that link from it are specific to Data Center. I have yet to find a solution for CF Cloud, but will reply here if I find something.


author: Bill Bailey
body: Have you looked at the [metadata plugins](https://marketplace.atlassian.com/plugins/org.andya.confluence.plugins.metadata/server/overview)? You could set a bunch of custom metadata values on a page at root (so it doesn't appear in the left-hand navigation), which can be referenced anywhere in Confluence.

I use this plugin to pass values to documents with the k15t Scroll export utilities.


author: EPS Software Engineering AG
body: Hi Fabian,

Maybe our App Easy Space Variables could help. You find it on the Marketplace.

Regards,  
Stephan (I am the CEO of EPS, the vendor of Easy Space Variables)

comments: author: Fabian Arndt
body: Thanks but we already try your plug-in. It seems do do exactly what we need.

:)


author: EPS Software Engineering AG
body: Ok, great. Please let us know if you need any assistance.


author: Robert Reiner _smartics_
body: There are similar questions:

* <https://community.atlassian.com/t5/Confluence-questions/How-can-I-use-variables-to-define-Space-properties-such-as/qaq-p/619160>
* <https://community.atlassian.com/t5/Confluence-questions/Can-I-use-variables-across-multiple-Confluence-pages/qaq-p/455365>

Maybe the User Macro approach (first link) is a solution to your requirements?

comments: author: Davin Studer
body: To add to this if you create a user macro to do the replacement you could put the macro in you page decorator so that is is automatically included on every page.


author: Shannon S
body: Hi Fabian,

I would recommend using [Excerpt Include Macro](https://confluence.atlassian.com/doc/excerpt-include-macro-148067.html?_ga=2.140912314.924331227.1516091163-306096126.1516091163) for this.

You can have a page with the main excerpts you'll be re-using, and then you can call them from other pages within Confluence. Keep in mind that a user will need to have view access to the source location if they are to see the excerpt on another page.

Let me know if you have any questions on how to use that.

Regards,

Shannon

comments: author: Fabian Arndt
body: Hello,

we already use that on some occasions. but that's not what we need.

What we need is a defined list of words which will be replaced by a set value.

$cname with mycompany


author: Shannon S
body: Fabian,

There's no additional feature like that at the moment, but we do have a feature request for it:

* [CONFSERVER-3999](https://jira.atlassian.com/browse/CONFSERVER-3999)

Otherwise, you may be able to use an add-on such as [Scripting for Confluence](https://marketplace.atlassian.com/plugins/org.swift.confluence.script/server/overview). It looks like you may be able to have set variables there.

Regards,

Shannon