Template Macro

Version 14.1 by Thomas Mortagne on 2011/10/27 18:12

cogCopy the script passed as argument into your script
TypeDoc (Velocity Macro)
Category
Developed byUnknown
Rating
0 Votes
LicenseUnknown

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
    

Get Connected