Defining and using the variable multiple times in template

Lakshmi Anantha Nallamothu
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!
October 8, 2024

I see examples of just defining and using the variable just one time in the confluence template. But I haven't got to understand how I can define once and use it multiple times in my template.

Please provide example if possible.

2 answers

0 votes
Barbara Szczesniak
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.
October 9, 2024

@Lakshmi Anantha Nallamothu The value of the variable is defined when you create a page from the template. If you insert the same variable in multiple places in your template (by copying it to make sure it has the same parameters), whatever value the person creating the page enters for the first instance is used in all other instances.

For example, if your template includes:

feature_name Overview

The feature_name feature is intended to …

feature_name Requirements

(using an underline to indicate the variable). The template will prompt for a value for this variable only once (since it's the same variable each time). If the page creator sets the feature_name variable to New Feature 1, the content of the new page would be:

New Feature 1 Overview

The New Feature 1 feature is intended to …

New Feature 1 Requirements

0 votes
Shawn Doyle - ReleaseTEAM
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 8, 2024

Hi @Lakshmi Anantha Nallamothu 

 

Have you tried just using it multiple times?  Below I created 1 variable and copied it onto my template multiple times. When creating a page and using the template, I typed in the value 'cookies' once and it populated all the instances of the variable.

 

vars.pngvars2.png

Lakshmi Anantha Nallamothu
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!
October 8, 2024

@Shawn Doyle - ReleaseTEAM Thanks for the reply. I don't want to copy the variable multiple times rather define once at top and they interpolate something like @Variable_name ..etc. But If there is no option to do this, then I may end up copying the Variable definition at all the places, which doesn't look good.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events