Changes for page Writing XWiki Rendering Macros in wiki pages
Last modified by Anca Luca on 2023/03/03
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. atallahade1 +XWiki.VincentMassol - Content
-
... ... @@ -35,14 +35,17 @@ 35 35 36 36 This class contains the following fields: 37 37 38 -* Macro id: Id of the macro to be used by users when invoking your macro from wiki code 39 -* Macro name: Name of the macro to be displayed on the wysiwyg editor 40 -* Macro description: A short description of the macro to be displayed on the WYSIWYG editor 41 -* Default category: Default category under which this macro should be listed 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 44 -* Content description: A short description about the macro's content to be displayed on the WYSIWYG editor 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) 38 +* **Macro id**: Id of the macro to be used by users when invoking your macro from wiki code 39 +* **Macro name**: Name of the macro to be displayed on the wysiwyg editor 40 +* **Macro description**: A short description of the macro to be displayed on the WYSIWYG editor 41 +* **Default category**: Default category under which this macro should be listed 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 44 +* **Content description**: A short description about the macro's content to be displayed on the WYSIWYG editor 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 +* **Asynchronous rendering**: {{info}}Since 10.10{{/info}} Enabled or disable asynchronous rendering of the panel. Disabled by default. 47 +* **Cached**: {{info}}Since 10.10{{/info}} Indicate if the result of the execution of the element should be cached. Disabled by default. 48 +* **Context elements**: {{info}}Since 10.10{{/info}} The context information required during the execution of the extension (current user, current document, etc.). It's also used to generate the cache key. 46 46 47 47 Now we can define our hello macro as shown below: 48 48 ... ... @@ -73,10 +73,10 @@ 73 73 Introducing a parameter to a wiki macro is pretty straight forward; you simply need to add an object of type ##XWiki.WikiMacroParameterClass## into your wiki macro document (one object per parameter). This class contains several fields that allow you to define your parameter clearly: 74 74 75 75 * Parameter name: Name of the parameter, users will refer this name when invoking your macro with parameters 76 -* Parameter description: A short description of the parameter, this description will be made available on the WYSIWYG editor 79 +* Parameter description (optional): A short description of the parameter, this description will be made available on the WYSIWYG editor 77 77 * Parameter mandatory: Indicates if this particular parameter is mandatory, wiki macro will fail to execute if a mandatory parameter is missing 78 -* Parameter default value: The default value of the parameter when it's empty 79 -* Parameter type: Indicates in which type the parameter value should be converted in (java.lang.String by default) 81 +* Parameter default value (optional): {{info}}Since 10.10{{/info}} The default value of the parameter when it's empty 82 +* Parameter type (optional): {{info}}Since 10.10{{/info}} Indicates in which type the parameter value should be converted in (java.lang.String by default) 80 80 81 81 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: 82 82