From version 112.1
edited by Simon Urli
on 2019/07/03
To version 113.1
edited by Simon Urli
on 2019/07/03
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -97,7 +97,15 @@
97 97  
98 98  A macro parameter defined this way can be accessed from any scripting language within the macro code. For example, we are going to utilize our //greetUser// parameter within **hello macro** as shown below:
99 99  
100 -[[image:macro4.png]]
100 +{{code}}
101 +{{velocity}}
102 +#if ($wikimacro.parameters.greetUser && "XWiki.XWikiGuest" != "$xcontext.user")
103 + Hello $xwiki.user.email!
104 +#else
105 + Hello world!
106 +#end
107 +{{/velocity}}
108 +{{/code}}
101 101  
102 102  As you might have realized already, direct binding of parameters is not supported at the moment. That is, you cannot access //greetUser// parameter with **$greetUser**. Instead you must use **$wikimacro.parameters.greetUser**. We plan to introduce some form of direct parameter binding in near future.
103 103  
... ... @@ -148,7 +148,7 @@
148 148  
149 149  [[image:macro2.png]]
150 150  
151 -[[image:macro5.png]]
159 +[[image:macro4.png]]
152 152  
153 153  == Special code for WYSIWYG edit mode ==
154 154  

Get Connected