Last updated Oct 20, 2020

Rate this page:

Velocity template overview

Velocity is a server-side template language used by Confluence to render page content. Velocity allows Java objects to be called alongside standard HTML.

If you are are writing a user macro or developing a plugin you may need to modify Velocity content.

Example usage

A variable in velocity looks like this:


To set a variable:

#set ($message = "Hello")

A basic if statement:

#if ($message == "Hello")
   Message received and is "Hello"

A velocity variable which evaluates to null will simply render as the variable name.

See the Velocity user guide for a more comprehensive introduction to Velocity.

Rate this page: