It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

What is the point of Blueprint Variables?

Confluence 5.1

What is the point of Blueprint Variables? I can't seem to reference them, and there is not much documentation.

Here is what I'm trying to do:
1) Created a Blueprint and created a variable in the document properties called $featureLabel

2) Within this template, I have inserted a Page Properties Report macro

3) Within this macro, I would like to specify my variable, $featureLabel, as the Label parameter.

However, when I view the page, I get the error:

"The specified label $featureLabel does not exist."

I've tried representing the variable as {featureLabel} and @featureLabel@, but no joy.

I'm guessing that I am not referencing the variable in the correct manner, but how do I do this?

If I can not do such a simple substitution, then what is the point of these variables?

1 answer

See the intermediate Blueprint tutorial.  Regarding your technique using the properties file, they use this properties file there and you can see that it only sets DOM-like elements to be used while the blueprint is being used and also some system-required values like the name of the plugin, etc.  They can be referenced by your soy/html templates for the Blueprint wizard.

I don't think these are meant to persist after the page is created, I think they are static.  

I wouldn't call what you are doing as "variables", I'd call that "setting properties" for the plugin. I think you would want to use regular Template variables for what you want.  Since these would be legit Template variables, they would probably register with your page properties MACRO.

So in summary, the Blueprint is just a stepping stone for creating the page, it's not going to get you persistent page properties.  Why are you using a Blueprint?  If you only need these variables, I think a Template would be what you need, unless you have other creation tasks.

(tl;dr; begin) FWIW:

I have a different understand of what a "Blueprint Variable" is.

I'm using variables in Blueprints with this <at:> syntax business in the template:

&lt;table&gt;
...
&lt;tr&gt;&lt;th colspan="1"&gt;ReqID&lt;/th&gt;
&lt;td colspan="1" &gt;
&lt;at:var at:name="reqID" /&gt;
&lt;/td&gt;
&lt;/tr&gt;
...&lt;/table&gt;

These are entered client side in the wizard and bound by element name, i.e.:

&lt;input id="reqID" class="text" type="text" name="reqID"&gt;

Then I'm grabbing these server side in JAVA in a ContextProvider instance, where I can do back-end stuff using those values and pre-fill some other fields before the page is finally approved by the user.

All of this is transient though in that once the page is created, this all goes "out of scope".

NOTE: One thing I haven't figured out is how to get these type of "variables" to populate corresponding TEMPLATE variables.

 

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published Mar 12, 2019 in Confluence

Confluence Admin Certification now $150 for Community Members

More and more people are building their careers with Atlassian, and we want you to be at the front of this wave! Important Dates Start the Certification Prep Course by 2 April 2019 (you can also ...

2,510 views 14 20
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you