Extensions Wiki » Extensions » Template Macro

Template Macro

Last modified by Vincent Massol on 2013/03/11 09:38
cogCopy the script passed as argument into your script
TypeMacro (Velocity)
Developed by

XWiki Development Team

LicenseGNU Lesser General Public License 2.1
Bundled With

XWiki Enterprise, XWiki Enterprise Manager

Description

This is the equivalent of the C preprocessor include directive.

Usage

#template($relativeURL)

Parameters definition

The path to the script you want to include.

The path is relative to the directory of your skin. For example, if you are using the albatross skin, and have installed XWiki using the installer with default settings, the skin path will be :

C:\Program Files\XWiki Enterprise\webapps\xwiki\skins\albatross

So if you have a skin script called myscript.vm you want to include, and that script is located in a folder mydir inside the skin folder,

C:\Program Files\XWiki Enterprise\webapps\xwiki\skins\albatross\mydir\myscript.vm

you will use the following Velocity instruction in your scripts :

#template("mydir/myscript.vm")

Example

#template("comments.vm")

Result

templateMacro.png

Tags: script
Created by jeanvivienmaurice on 2007/11/14 16:32

Download XWiki