Hey Marc,

Another nice line for your TurbineResources.properties file:

services.VelocityService.velocimacro.library.autoreload = true

I wish I would have looked it up sooner, when I was getting started with Velocity macro libs.


At 3:41 PM +0100 9/16/02, Nathan Barron wrote:
Hi

You need to create macro functions that will act lke methods.
You place the functions you want in a file named 'file.vm'
You can get the syntax for building the functions by reading the following
documentation:
http://jakarta.apache.org/velocity/user-guide.html#Velocimacros

To make the macros available to every vm file in your application you must
set the following parameter in your main application configuration file. If
you are using turbine the following parameter should be included in the
TurbineResources.properties file:
services.VelocityService.velocimacro.library =
path1/to/file/MacroFile1.vm,path2/to/file/MacroFile2.vm

Hope that helps

Nathan

-----Original Message-----
From: Marc Lustig [mailto:[EMAIL PROTECTED]]
Sent: 16 September 2002 15:42
To: [EMAIL PROTECTED]
Subject: using Velocity Macros

Hi,

I want to build my own Macro-library to be available at all vm-files accross
my application.
Do I save them with vm-ending as well? Like "macros.vm"
What's the right place to put this file? ../templates/app/ ?
What's the proper central place to import it so that I don't have to import
it using parse() everytime a create a new app-template? Is it the file that
holds my overall layout ../templates/app/layouts/Default.vm?

Thanx.
Marc


--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs service.


________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs service.
________________________________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to