Guillaume Lerouge wrote:
First you need to put all your macros in one
page, let's say
XWiki.MyMacros . Then you'll have to go to the Administration, Tab
Preferences, Line Advanced. Then put the name of your page in the
Velocity Macro Pages field (you can put only one page there for
performance reasons). So you'll have :
Velocity Macro Pages :
XWiki.MyMacros
Then save the page. You can now call your macros from wherever in the
wiki.
Thanks, Guillaume. It works fine. I was putting the document in the
wrong method. Is it worth a FAQ entry?
Are you aware of any performance difference between this approach and
the one prosed by Sergiu?
Just looked at the code to see how it works.
Registering in velocity.properties causes the file to be parsed once
when the platform starts.
Registering in XWikiPreferences causes the file to be parsed for each
line (!) of the parsed document.
--
Sergiu Dumitriu