Changes for page Writing XWiki Rendering Macros in wiki pages
Last modified by Clément Desableau on 2023/06/01
Change comment:
There is no comment for this version
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. VincentMassol1 +XWiki.surli - Content
-
... ... @@ -40,7 +40,8 @@ 40 40 * **Macro description**: A short description of the macro to be displayed on the WYSIWYG editor 41 41 * **Default category**: Default category under which this macro should be listed 42 42 * **Supports inline mode**: Whether the macro can be used in an inline context or not 43 -* **Macro content type**: Whether this macro should support a body or not 43 +* **Macro Content availability**: {{warning}}before 11.5RC1 this was called **Macro Content Type**{{/warning}} whether this macro should support a body or not 44 +* **Macro content type**: {{warning}}this field has been renamed **Macro Content Availability** since 11.5RC1{{/warning}} the type of accepted content: two values are proposed, {{code}}WIKI{{/code}} if this content should be editable like a wiki content, or {{code}}UNKNOWN{{/code}} if it should be displayed like a plain text. It's also possible to specify a custom java type such as {{code}}java.util.List<java.lang.String>{{/code}}. Leaving the field blank is equivalent to {{code}}UNKWOWN{{/code}} value. 44 44 * **Content description**: A short description about the macro's content to be displayed on the WYSIWYG editor 45 45 * **Macro code**: The actual wiki code that will be evaluated when the macro is executed, can be any xwiki content (should be in the same syntax as the document) 46 46 * **Asynchronous rendering**: {{info}}Since 10.10{{/info}} Enabled or disable asynchronous rendering of the panel. Disabled by default. ... ... @@ -64,6 +64,7 @@ 64 64 == Content == 65 65 66 66 Starting with {{code}}XWiki 11.4RC1{{/code}} there are two ways to insert the content of the wiki macro. 68 + 67 67 * The easiest way is to use a dedicated macro in the body of the wikimacro:((( 68 68 {{code language="none"}} 69 69 {{wikimacrocontent/}} ... ... @@ -99,6 +99,10 @@ 99 99 100 100 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. 101 101 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"}}Hello {{wikimacroparameter name="greeUsers" /}} 106 +{{code}} 107 + 102 102 Finally, we can test our new version of **hello macro** with the following invocation: 103 103 104 104 {{code language="none"}} ... ... @@ -112,7 +112,7 @@ 112 112 #set ($greet = true) 113 113 {{hello greetUser="$greet"/}} 114 114 {{/velocity}} 115 -{{/code}} 121 +{{/code}}{{/code}} 116 116 117 117 == Translations == 118 118