I have a old user macro with one default parameter.
#if($param0) #set ($object = $generalUtil.htmlEscapeQuotes($param0)) <a href="http://some_address?object=$object&otherParam">$object</a> #else Define link parameter! #end
{link:some_object_atribute}
Question is: what should I use for the parameter name of default parameter? I not found in documentation yet.
## @param ## @param 0 ## @param param0 ## @param 0:title=Object ## @param :title=Object ## @param param0:title=Object
Hi Nic,
Your advice does not help me. Maybe better describe what bothers me.
We have updated Confluence. We have ext -anch macro (for open link in new window). First parameter (unnamed) with the title, second is {{url}} and optional {{tagret}}.
This is old user macro without meta data. For users looking macro in editor as follows:
ext-anch_macro_in_editor.png
Where 15
is unnamed first parameter display as title in page preview.
The url
is normal named parameter with url and target
parameter not present yet.
When user click on the macro in editor, was displayed a warning message:
ext-anch_macro_in_editor_no_metadata.png
Ok, we added some metadata into macro:
## ## @param url:title=Url|type=string|required=true ## @param target:title=Target|type=string ##
and user can edit parameter url
and target
now:
ext-anch_macro_with_metadata_without_def_param.png
But if such an adjustment saves, losing the first (unnamed) parameter.
Cheers,
Libor
There is no concept of "default parameter", you need to feed user macros proper parameters now.
But you can keep it simple. Your third line will work - you can say ## @param param0, and it will assume you mean it's a string, and it will then be usable by looking at $paramparam0
Although, I've tended to use a style more like ## @param BetterName, as that leads to something easier to read later in the code - $paramBetterName
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.