Changes for page Writing XWiki Rendering Macros in wiki pages
Last modified by Simon Urli on 2023/10/10
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -28,8 +28,13 @@ 28 28 29 29 == Definition == 30 30 31 -Wiki macros are defined using objects of type ##XWiki.WikiMacroClass##. You define a wiki macro by creating a new wiki page and attaching to it an object of type ##XWiki.WikiMacroClass##. This class contains the following fields:31 +Wiki macros are defined using objects of type ##XWiki.WikiMacroClass##. You define a wiki macro by creating a new wiki page and attaching to it an object of type ##XWiki.WikiMacroClass##. 32 32 33 +{{warning}}There can be only one object of type ##XWiki.WikiMacroClass## per wiki page (if you add more only the first will be used).{{/warning}} 34 + 35 + 36 +This class contains the following fields: 37 + 33 33 * Macro id: Id of the macro to be used by users when invoking your macro from wiki code 34 34 * Macro name: Name of the macro to be displayed on the wysiwyg editor 35 35 * Macro description: A short description of the macro to be displayed on the WYSIWYG editor ... ... @@ -55,12 +55,14 @@ 55 55 56 56 == Content == 57 57 58 -If macro content is used, it can be shown by executing following velocity code in macro body: 63 +If macro content is used, it can be shown by executing the following velocity code in the macro body: 59 59 60 60 {{code language="none"}} 61 61 {{velocity}}$xcontext.macro.content{{/velocity}} 62 62 {{/code}} 63 63 69 +For more details, see the [[Scripting Tips section below>>||anchor="HScriptingTips"]]. 70 + 64 64 == Parameters == 65 65 66 66 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: