This macro is bundled with all the XWiki products by default.
Macro developed by the XWiki Development Team.
This macro cannot currently be downloaded separately.

Template Macro

This is the equivalent of the C preprocessor include directive : the result is a copy of the script passed as argument, into your script.

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

Comments for TemplateMacro

VincentMassol | 14.11.2007 at 09:04 PM
Jean-Vivien, what do you think of documenting the TemplateMacro here instead of in the "Include on Velocity" page and modify "Include on Velocity" to refernce the different macros in the code zone?

It would be nice if all the macros could be documented in the Code Zone.

Thanks!

Version 7.1 last modified by VincentMassol on 19/06/2008 at 22:13

Comments 1

VincentMassol | 14.11.2007 at 09:04 PM
Jean-Vivien, what do you think of documenting the TemplateMacro here instead of in the "Include on Velocity" page and modify "Include on Velocity" to refernce the different macros in the code zone?

It would be nice if all the macros could be documented in the Code Zone.

Thanks!

Attachments 0

No attachments for this document

Creator: jeanvivienmaurice on 2007/11/14 16:32
This wiki is licensed under a Creative Commons license
1.4.1.10194