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. mleduc1 +XWiki.lucaa - Content
-
... ... @@ -40,7 +40,7 @@ 40 40 41 41 == Invocation == 42 42 43 -A wiki macro can be invoked just like any other macro is invoked. Since we are writing a xwiki/2. 0wiki macro, we can invoke our **hello macro** as below:43 +A wiki macro can be invoked just like any other macro is invoked. Since we are writing a xwiki/2.1 wiki macro, we can invoke our **hello macro** as below: 44 44 45 45 {{code language="none"}} 46 46 {{hello/}} ... ... @@ -148,15 +148,17 @@ 148 148 149 149 = Bindings = 150 150 151 - Seeallavailalbebindingsin[[thereferencedocumentationpage>>doc:extensions:Extension.WikiMacroStore.WebHome||anchor="HBindings"]].151 +The usual XWiki [[scripting context bindings>>doc:extensions:Extension.Script Macro||anchor="#HBindings"]] are available in the scripts of the wiki macros, with the mention that contextual variables (such as ##$doc##) will point to the XWiki document (page) in which the macro is called, not to the XWiki document containing the objects that define the macro. This makes it easy to write macros that apply to the page where they're called. 152 152 153 +Then, specific bindings for the wiki macro context are available, see [[the reference documentation page>>doc:extensions:Extension.WikiMacroStore.WebHome||anchor="HBindings"]]. 154 + 153 153 = WYSIWYG Access = 154 154 155 155 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: 156 156 157 -[[image:macro2.png]] 159 +[[image:macro2.png||height="293" width="350"]] 158 158 159 -[[image:macro4.png]] 161 +[[image:macro4.png||height="149" width="350"]] 160 160 161 161 == Special code for WYSIWYG edit mode == 162 162 ... ... @@ -232,7 +232,7 @@ 232 232 This pitfall has been fixed in XWiki 2.2 233 233 {{/info}} 234 234 235 -There is a common pitfall for using optional paramters. The following macro code contains a not so obvious bug: 237 +There is a common pitfall for using optional parameters. The following macro code contains a not so obvious bug: 236 236 237 237 {{code languege="velocity"}} 238 238 {{velocity}}