Last modified by Simon Urli on 2023/10/10

<
From version < 22.1 >
edited by Asiri Rathnayake
on 2009/07/20
To version < 25.1 >
edited by Asiri Rathnayake
on 2009/07/20
>
Change comment: Upload new image <a href="/xwiki/bin/downloadrev/DevGuide/WikiMacroTutorial/macro1.png?rev=1.4">macro1.png</a>

Summary

Details

Page properties
Content
... ... @@ -5,6 +5,8 @@
5 5  
6 6  1 Wiki Macro Tutorial
7 7  
8 +#error("This document is still under development")
9 +
8 8  Wiki macros allow macro authors to develop reusable and distributable macro modules. There is no java code involved; hence no compiling or packaging. Macro author simply needs to create a wiki page according to a particular specification and that's all!
9 9  
10 10  1.1 Prerequisites
... ... @@ -13,7 +13,7 @@
13 13  * Wiki macro authors need to have programming rights
14 14  * Wiki macros can only be defined inside the main wiki, though they can be used throughout a farm
15 15  
16 -1.1 Hello World Macro
18 +1.1 Hello Macro
17 17  
18 18  We are going to start with a very simple xwiki/2.0 wiki macro which prints a greeting message to the document content. It isn't a very useful macro but the idea is to get you familiarised with the wiki macro creation process.
19 19  
... ... @@ -25,13 +25,13 @@
25 25  
26 26  * Macro description: A short description of the macro, this description will be made available on the WYSIWYG editor (More on this later)
27 27  
28 -* Macro content: The actual wiki content that will be evaluated when the macro is executed, can be any wiki content (should be in the same syntax as the document)
30 +* 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)
29 29  
30 -Now we can define our hello world wiki macro as shown below:
32 +Now we can define our hello macro as shown below:
31 31  
32 32  {image:macro1.png}
33 33  
34 -1.1.1 Wiki Macro Invocation
36 +1.1.1 Macro Invocation
35 35  
36 36  A wiki macro can be invoked just as any other macro is invoked. Since we are writing a xwiki/2.0 wiki macro, we can invoke our hello world macro as below:
37 37  
macro1.png
Size
... ... @@ -1,1 +1,1 @@
1 -136.1 KB
1 +25.4 KB
Content

Get Connected