You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Nathan Barron <na...@Rightmove.co.uk> on 2002/09/16 16:41:20 UTC
RE: using Velocity Macros
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:mail@marclustig.com]
Sent: 16 September 2002 15:42
To: turbine-user@jakarta.apache.org
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:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs service.
________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs service.
________________________________________________________________________
RE: using Velocity Macros
Posted by Johnny Quazar <qu...@bitblaster.com>.
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:mail@marclustig.com]
>Sent: 16 September 2002 15:42
>To: turbine-user@jakarta.apache.org
>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:
><ma...@jakarta.apache.org>
>For additional commands, e-mail:
><ma...@jakarta.apache.org>
>
>
>________________________________________________________________________
>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: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org