Hi all,

 

I have again problems with macros, contained in a page (XWiki.MyMacros).

This page is referenced in XWiki.XWikiPreferences, in field “Velocity Macro Pages”, value being “XWiki.MyMacros”.

 

It used to work well with 0.9.840 and 1.0, all macros were correctly interpreted in all pages. But now from 1.1M3 and 1.1M4 it does not work anymore …

Do you have any idea why it wouldn’t work anymore ?

 

Also, during wiki migrations, I did not reimport last XWiki.XWikiPreferences pages, to keep my preferences. Could it explain the problem ? Do you advise reimporting the last versions (1.1M4) of XWiki.XWikiPreferences page ? Also, how is it possible for such pages (XWiki core) to compare them to the old ones, and to see if there are differences ?

 

Thanks for your help,

 

Best regards,

 

 

Jeremie

 

 

 


From: BOUSQUET Jeremie [mailto:Jeremie.BOUSQUET@gemalto.com]
Sent: mercredi 9 mai 2007 11:46
To: xwiki-users@objectweb.org
Subject: RE: [xwiki-users] How to create a macro ?

 

Hello all,

 

Sorry, Vincent Massol already answered with the new possibility of referencing the macro page in administration part.

 

I confirm : it works !

 

Thanks,

 

Jérémie

 


From: BOUSQUET Jeremie [mailto:Jeremie.BOUSQUET@gemalto.com]
Sent: jeudi 3 mai 2007 10:50
To: xwiki-users@objectweb.org
Subject: RE: [xwiki-users] How to create a macro ?

Hello,

 

I applied exactly the solution proposed by Brian in my Wiki (see his answer below) : create macros in a specific wiki document, import it with an #includeMacros macro located inside the "View" field of my skin, like this:

###
### Main "view" template
###
### General wrapper for view actions
###
[.......]

</div>## main
#template("endpage.vm")
#includeMacros('XWiki.MyMacros')
#end

 

My problem is that the macro includeMacros adds {pre} / {/pre} tags that get rendered, and so appear in all pages. I cannot put them inside the "content" of the page, because I would have to overload the "contentview.vm" file, in which is declared the "xwikicontent" div.

 

How can I get rid of those {pre} {/pre} tags ?  I would like to avoid overloading the "contentview.vm" because I think it's not a good thing to do (it's not in the default templates, but in the skins) ...

 

Thanks,

 

Jérémie

 


From: THOMAS, BRIAN M (ATTSI) [mailto:bt0008@att.com]
Sent: mercredi 25 avril 2007 18:58
To: xwiki-users@objectweb.org
Subject: RE: [xwiki-users] How to create a macro ?

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