Template Macro

The "Template" macro allows you to include the script passed as argument into the current script. Only the Velocity parser will be executed on the file passed as argument.

Usage

#template($relativeURL)

Only the Velocity parser will be executed on the file passed as argument. The priority of the executed files is as follows:

  • a property of the XWiki.XWikiSkins object attached to the current skin document.
  • a ".vm" file attached to the current skin document.
  • a ".vm" file located in the directory corresponding to the current skin as shown in the below examples.
  • the above 3 locations corresponding to the base skin.
  • the above 3 locations corresponding to the default skin.
  • a ".vm" file located in the "templates" folder as shown in the below examples.

Parameters

The $relativeURL is the path to the included script which can be:

  •  a relative URL to a folder on your filesystem like for instance a skin directory:
    #template('C:\Apache Software Foundation\Tomcat 6.0\webapps\xwiki\skins\colibri\customTemplate.vm')

    #template('C:\Apache Software Foundation\Tomcat 6.0\webapps\xwiki\skins\colibri\templates\customTemplate.vm')
  • the name of a default XWiki Velocity template file (i.e. located in the "templates" folder):
    #template('warning.vm')

Related Pages

Search this space

 

Most popular tags

Failed to execute the [groovy] macro
  1. access rights
  2. activity stream
  3. annotation
  4. attachment
  5. comment
  6. Document Tree Macro
  7. export
  8. Extension Manager
  9. Flamingo skin
  10. global user
  11. Groovy event listener
  12. group
  13. nested page
  14. search
  15. skin
  16. syntax
  17. user
  18. user profile
  19. velocity macros
  20. wiki
  21. wysiwyg
  22. XWiki Applications
  23. xwikiattachment_archive table
  24. xwikiattachment table
  25. xwikiattrecyclebin table
  26. xwikiproperties table

[Display all tags from this space]