From version 104.1
edited by Simon Urli
on 2019/06/11
To version 105.1
edited by Simon Urli
on 2019/06/25
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -89,7 +89,7 @@
89 89  * Parameter description (optional): A short description of the parameter, this description will be made available on the WYSIWYG editor
90 90  * Parameter mandatory: Indicates if this particular parameter is mandatory, wiki macro will fail to execute if a mandatory parameter is missing
91 91  * Parameter default value (optional): {{info}}Since 10.10{{/info}} The default value of the parameter when it's empty
92 -* Parameter type (optional): {{info}}Since 10.10{{/info}} Indicates to which Java type the parameter value (defined as a String) must be converted to (##java.lang.String## by default)
92 +* Parameter type (optional): {{info}}Since 10.10{{/info}} Indicates to which Java type the parameter value (defined as a String) must be converted to (##java.lang.String## by default) This type must be necessarily a concrete class in order to be properly used in the converter.
93 93  
94 94  Now we're going to extend our **hello macro** with a parameter. We will introduce a parameter named //greetUser// that will indicate if the greeting message should be tailored for the current user viewing the page. The definition of the parameter is shown below:
95 95  
... ... @@ -102,9 +102,7 @@
102 102  As you might have realized already, direct binding of parameters is not supported at the moment. That is, you cannot access //greetUser// parameter with **$greetUser**. Instead you must use **$xcontext.macro.params.greetUser**. We plan to introduce some form of direct parameter binding in near future.
103 103  
104 104  Since {{info}}11.5RC1{{/info}}, it is also possible to display the content of a macro parameter by using a dedicated macro:
105 -{{code language="none"}}
106 -Hello {{wikimacroparameter name="greeUsers" /}}
107 -{{/code}}
105 +{{code language="none"}}Hello {{wikimacroparameter name="greeUsers" /}}{{/code}}
108 108  
109 109  Finally, we can test our new version of **hello macro** with the following invocation:
110 110  

Get Connected