On Jul 1, 2008, at 4:43 PM, Ludovic Dubost wrote:
If you add in your page
#macro(hi $name) $xwiki.myplugin.function($name) #end
then you will be able to use
#hi("Michael")
Once you are happy with your macro you can add it to a macros.vm page and declare it in velocities.properties (restart needed)
Note: there is no velocity.properties file anymore ;) I need to implement support for global velocity macros in the preferences UI. Right now if you really want to make them global you'll need to either edit META-INF/plexus/components.xml file located in the xwiki-core- velocity jar, override the definition in your plexus.xml file or add them to your skin's macros.vm on the filesystem. But the simplest (although a bit cumbersome) right now is simply to use #includeMacros("macropage") wherever you need to use them. Thanks -Vincent
MikhaelSantos wrote:
Hi guys!
I'm trying to add my own macros on xwiki but they are functions made in java. for example if I had to edit a xwiki page and added xwiki.myplugin.function("Mikhael") on the preview my function would show the following Text : "Hello Mikhael your plugin is working!". Now what I want to know is how do a turn xwiki.myplugin.function("Mikhael") into for example " $hi("Mikhael") "? Give it a more macro look.
I look foward to your answers and thank you for helping out Mikhael