Howaremacrosused
Last modified by Sergiu Dumitriu on 2020/01/28
Question | How are macros used? I tried to use the \#warning("Hello World") macro but all I got was the output "\#warning("Hello World")". |
Answer |
There are two kinds of macros, velocity macros and syntax macros, and there are two main document syntaxes available, xwiki/1.0 and xwiki/2.0.
Since xwiki/2.0 is the default syntax now, to use a velocity macro you should write something like this: {{velocity}} \#warning("Something is wrong") {{/velocity}} Note that for this particular case, there's also a syntax macro, so you should write: {{warning}}Something is wrong{{/warning}} |