To expand on Thomas's second option, you can actually put either the macro definition or a directive including the document containing it into the view template of your skin (to make it global as you desired).  This can be done either by modifying /templates/view.vm or the "view" field of your skin (which, if non-empty, will override view.vm).
 
And to clarify his reply slightly, the original macros.vm is actually in the /templates directory.  If you wish your macro to be global, regardless of the skin, I think you will want to edit that one instead of the one in your skin directory.  This is apparently a change from the pre-1.0 days, when the skins directories didn't contain template files - I presume that they are now copied there from /templates when a skin is created.
 
Vincent (or anybody), can you confirm this?  Are these files actually copied whenever a skin is created, or only when a custom version of the file's content is desired?
 
Also, as Vincent mentions in an intervening reply, you can load macros from an XWiki document rather than from a file, using the #includeMacros macro (which, in 0.9.8
 
 
brain[sic]
 


From: Thomas Kliethermes [mailto:kliether@us.ibm.com]
Sent: Wednesday, April 25, 2007 10:02 AM
To: xwiki-users@objectweb.org
Subject: Re: [xwiki-users] How to create a macro ?


From what I understand, there's two ways to do it.  One, add it to macros.vm in your skin directory.  Two, put it in a .vm file you include in the document you need to use it in (using #template("filename.vm")).  Anyone know if there any better ways?

-Tom

--
Tom Kliethermes
eSupport Initiatives
IBM Information Management
(913) 599-7240   Fax: (913) 599-8590
http://www.ibm.com/software/data



roopesh@digitalglue.in

04/25/2007 02:19 AM
Please respond to
xwiki-users@objectweb.org

To
xwiki-users@objectweb.org
cc
Subject
[xwiki-users] How to create a macro ?





Hi

How can I create my own macro in my xwiki (say, a macro for adding two numbers). Where should I write it. So that I can use it from any page ?

Regards
Roopesh


--
You receive this message as a subscriber of the xwiki-users@objectweb.org mailing list.
To unsubscribe: mailto:xwiki-users-unsubscribe@objectweb.org
For general help: mailto:sympa@objectweb.org?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws