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 (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -47,7 +47,7 @@ 47 47 48 48 1.1.1 Parameters 49 49 50 -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 syou to define your parameter clearly:50 +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: 51 51 52 52 * Parameter name: Name of the parameter, users will refer this name when invoking your macro with parameters 53 53 ... ... @@ -59,11 +59,16 @@ 59 59 60 60 {image:macro3.png} 61 61 62 +A macro parameter defined this way can be accessed from any scripting language within the macro code. For an example, take a look at how we are going to utilize our ~~greetUser~~ parameter within the hello macro: 63 + 64 +{image:macro4.png} 65 + 62 62 #error("This section is being updated") 63 63 64 64 65 65 66 66 71 + 67 67 1.1 WYSIWYG Access 68 68 69 69 A wiki macros is treated just like any other rendering macro in the system. As such, the moment you save your wiki macro it will be available to the users through the WYSIWYG editor's *Insert Macro* dialog box: