How documented by the first parameter in the User Macro?
Asked by Libor Tvrd?k:

I have a old user macro with one default parameter.

```
#if($param0)  #set ($object = $generalUtil.htmlEscapeQuotes($param0))  &lt;a href="http://some_address?object=$object&amp;otherParam"&gt;$object&lt;/a&gt;#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](https://confluence.atlassian.com/x/Ww7PKQ) yet.

```
## @param## @param 0## @param param0## @param 0:title=Object ## @param :title=Object## @param param0:title=Object
```


Answers:
author: Libor Tvrd?k
body: Hi Nic,

Your advice does not help me. Maybe better describe what bothers me.

<br />

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.

### Question is {#toc-hId-1154200847}

### What can I do to allow the user to edit old title (first unnamed parameter)? {#toc-hId-2041704528}

<br />

Cheers,

Libor  
[](https://community.atlassian.com/t5/Confluence-questions/How-documented-by-the-first-parameter-in-the-User-Macro/qaq-p/11469?attachment-id=4718){#link_1188aab01b4b9e}  
[](/tnckb94959/attachments/tnckb94959/confluence-questions/1916/1/ext-anch_macro_in_editor_no_metadata.png){#display_1188aab01b4b9e_0}  
[](https://community.atlassian.com/t5/Confluence-questions/How-documented-by-the-first-parameter-in-the-User-Macro/qaq-p/11469?attachment-id=4719){#link_1188aab01b4b9e_0}  
[](/tnckb94959/attachments/tnckb94959/confluence-questions/1916/2/ext-anch_macro_in_editor.png){#display_1188aab01b4b9e_2}  
[](https://community.atlassian.com/t5/Confluence-questions/How-documented-by-the-first-parameter-in-the-User-Macro/qaq-p/11469?attachment-id=4720){#link_1188aab01b4b9e_1}  
[](/tnckb94959/attachments/tnckb94959/confluence-questions/1916/3/ext-anch_macro_with_metadata_without_def_param.png){#display_1188aab01b4b9e_4}


author: Nic Brough -Adaptavist-
body: 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

```
?
```


Tags: confluence-administration