Confluence templates variables don't work

Deleted user April 7, 2013

I can't seem to be able to make variables in a template in Confluence. I can't seem to find how to make variables in the system. Where can I find a how to enable variables?

4 answers

1 accepted

0 votes
Answer accepted
Steffen Heller
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 8, 2013

In my case the "Create variable" option is automatically highlighted and so a click on the space key will also do and have the same effect. All you have to avoid is to mouse click somewhere else because this will remove the highlighting and then you get "nothing".

3 votes
Helder Martins June 4, 2019

Hi, I did this and I am able to create several variables and they show on my template editing, however, when I go and try to create a page using the template which I included my variables, I expected the different variables (like a "List") show up so I could use the actual field as part of the content.

Am I missing something to make the variable show up when creating the pages? I understood I would create a variable i.e: a List type, and it would show up as a dropdown where I would be able to select all the options I separated by commas when I defined the variable. Isn't this the case?

Mauricio Underbrink
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!
June 4, 2019

I am having the same issue, it does works when doing a preview of the template but once creating a page using that template my variables will not work. 

Like # people like this
Helder Martins June 5, 2019

@Mauricio UnderbrinkI think I was able to figure this out, at least partially: instead of trying to edit an existing template, I went ahead and created a NEW template. After doing this, I tried the same approach and created my variables with the intention of having lists, text fields, etc. After doing this, it actually worked, and showed up as part of the page.

Keep in mind something and it's like it works like an initial form, so, it will display and allow the person creating a new page to first only fill out that particular form (set of variable fields) and then, after clicking next (submitting them) you can continue with the rest.

Basically, these fields work as an initial form previous to do the rest of the content on the page. This might sound trivial but for me was different from what I imagined at the beginning, but in any case it worked out (sort of) for me. I hope it does for you.

0 votes
Steffen Heller
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 7, 2013

I don't see that drop down list either and my page looks quite different from the screenshot. And sometimes I also type $ plus something and it won't convert it into a variable. So I also thought I made something wrong but then suddenly it all worked.

Just a guess:
You could have a look at "Settings > Your settings: Editor" and see if you have disabled Autocomplete and/or Autoformatting.

Deleted user April 8, 2013

Ha, found it. What I should do is type $putnamehere and then simply click on Create variable. Tsss, UID could do better...

0 votes
Steffen Heller
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 7, 2013

Hello,

I don't know if I understand your question correctly because to me it seems so easy and self-explanatory:

Create a template:

  • Browse > Templates > Add new space template

Add variables:

  • Type the dollar sign plus the name of the variable that you want to create plus the space key or
  • Click on "$ Variables v" from the top menu

Perhaps you can be more specific about where you get stuck?

Deleted user April 7, 2013

Steffen; thank you for your answer; the problem is when I type the $ or select it nothing happens. I should be able to see a drop down like this: https://confluence.atlassian.com/download/attachments/296093779/Template_edit.png?version=4&modificationDate=1363747479635&api=v2

The problem is I don't see that!

Evgeni Boevski
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!
August 7, 2020

I didn't see it either. The solution is to ensure there are spaces around your cursor before typing the $ sign. If you try to stick the variable right next to a character, it won't work. After inserting the variable, delete the extra spaces.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events