Template Macro

This is a Velocity macro, 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 on TemplateMacro

  • VincentMassol, 2007/11/14 21:04
    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!

Tags:
Created by jeanvivienmaurice on 2007/11/14 16:32
Last modified by Sergiu Dumitriu on 2009/06/04 18:52

This wiki is licensed under a Creative Commons license
2.2.1.27354