Can I use variables across multiple Confluence pages?

Scott Eade April 14, 2016

I have a bunch of pages in a space that include references to things like client names. I want to be able to clone this space and have a means of updating the client name (amongst several other parameters) to some new value so that I can then commence working on documentation tailored to a specific client.

I can imagine a couple of ways of achieving this and this leaves my quite surprised that there is not a built-in feature or an obviously available plugin that will do what I want.

  • I could export a space and run a bunch of search/replace operations.
  • Nicer would be a configuration page for a space where I could set as many variables as I like and have these used when rendering page content within the space. These could be interpreted statically, i.e. when a page template is used, or dynamically, i.e. resolved at the time the page is rendered so that I can change them.

Is there a feature or plugin I am failing to see that can achieve this?

 

4 answers

1 accepted

0 votes
Answer accepted
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.
April 15, 2016

Our (commercial) projectdoc Toolbox Add-on allows to define properties for a space. These space properties are accessible by the Display Space Property Macro that is also part of the add-on.

So if you define a space blueprint or create a new page with references to space properties using the Display Space Property Macro, the values for these properties will be resolved on request time on this page.

For instance, if you define a space property (with the Document Properties Marker Macro on the space home page) named "Customer" with a value of "Example Inc." then the Display Space Property Macro, referencing the "Customer" property, will render the value "Example Inc.". When you change the name for the customer, the macro will always render the current value.

For more information on dealing with space properties, please refer to Using Space Properties on our web site (which I'd recommend as an introduction to this topic smile).

 

Scott Eade April 20, 2016

The projectdoc Toolbox plugin does a whole bunch of things, one of which is that it allows space and page level properties to be defined and used subsequently in other documents. This is precisely what I am after.

Having run a trial of this plugin it looks like it meets my needs and in fact I have now purchased it. As part of my solution I am also making use of the Copt Page Tree and Copy Space plugins.

I asked a few questions of the developers and quickly received a comprehensive response that included details of how to apply the tool in a couple of corner cases, so I am certainly pleased with their support and impressed by comprehensive capabilities of the plugin.

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 16, 2016

It's not as nice as variables, but you could do this with user macros - you can easily write one that could say client:address, and have a long list of clients in a "case" type statement.  Or, as I did for one place, have it based on the current space instead of a parameter (so you'd just say "client" and the macro would work it out from the space or other data somewhere)

The downside is that you'd need admin rights to edit the content, so it's not brilliantly flexible

 

0 votes
EPS Software Engineering AG
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.
April 15, 2016

Hi Scott,

With our add-on Space Tree Creator you can achieve the functionality you are looking for. The add-on does a search&replace during the creation process. The variables (tags) are marked by special characters (__) within normal Confluence pages. You don't need any programming skills.

Check out our live examples: link

Marketplace Link: Space Tree Creator

Regards,
Stephan

Scott Eade April 20, 2016

Thanks for your reply Stephan. Your plugin would appear to provide a nice way of applying variables at the time a tree of pages is created. This is an excellent solution, but in my case I am after the ability to modify the values even after the pages have been created.

0 votes
Adrian Reid April 14, 2016

The closest thing to this is the Excerpt or Multi-Excerpt plugin which reuses content on one page across pages.

But yes, a variable plugin would be great. How about it plugin developers?

EPS Software Engineering AG
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 9, 2017

Hi Adrian,

Christmas is quiet away, but here it is ;-)

The Easy Space Variables Add-on. Try it out and let us know, if it fits your needs.

Regards,
Stephan

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events