How to access variable createad on page in user macro?

Pavel Potcheptsov
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.
July 15, 2016

Suppose I've created a variable $Var1 in the global template and define MyMacro in this template too.

I'd like to multiply $Var1 by 10 and print output by MyMacro.

So I need somehow to access $Var1 in Velocity template.

How can I do that so if user filled out $Var1 for example with 5 so after saving page 50 will be displayed?

Thanks.

1 answer

0 votes
Bill Bailey
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.
July 16, 2016

And having the user enter the value in a user macro body won't work?

Pavel Potcheptsov
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.
July 17, 2016

There is option to create variables in Templates.

There is option to write own User Macro and use Velocity in Template section of User Macro.

When user creates new page from specified template he supposed to enter value in variable's field.

I want to get the content of the above variable in Velocity User Macro Template and do some action with it, so when new page is saved then my_user_macro produce output based on user input in variable field.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events