0 Votes

MyWiki

Version 10.1 by Ryan C on 2025/04/28 06:27
Warning
For security reasons, the document is displayed in restricted mode as it is not the current version. There may be differences and errors due to this.

XWiki Macros Reference Guide

Macros in XWiki are reusable pieces of functionality that can be integrated inside pages. They allow you to insert dynamic content or apply special formatting using a simple syntax. Below is a list of available macros (excluding deprecated or internal macros) along with their descriptions and usage examples.

TOC Macro

The TOC macro generates a Table of Contents.

Box Macro

The Box macro draws a box around the content inside it. This is useful for highlighting important information or grouping related content in a styled panel.

Note

This is a sample box message.

{{box title="Note"}}
This is a sample box message.
{{/box}}

Info Macro

The Info macro displays an informational message in a styled box. It is typically rendered with a blue color to denote general information.

Information

This is an informational message.

{{info}}
This is an informational message.
{{/info}}
Information
FYI

This is an informational message with a title.

{{info title="FYI"}}
This is an informational message with a title.
{{/info}}

Warning Macro

The Warning macro highlights a warning message in a styled box (yellow/orange background).

Warning

This is a warning message.

{{warning}}
This is a warning message.
{{/warning}}

Success Macro

The Success macro displays a success message in a green-styled box.

Success

This is a success message.

{{success}}
This is a success message.
{{/success}}

Error Macro

The Error macro displays a critical error or alert message in a red-styled box.

Error

This is an error message.

{{error}}
This is an error message.
{{/error}}

Chart Macro

The Chart macro generates graphical charts based on input tables.

{{chart type="pie" source="inline" params="range:B2-B4;series:columns;" width="400" height="300"}}
|=Category|=Value|
|A|10|
|B|20|
|C|30|
{{/chart}}
{{chart type="bar" source="inline" params="range:B2-C4;series:columns;" width="500" height="300"}}
|=Quarter|=Product X|=Product Y|
|Q1|20|15|
|Q2|30|25|
|Q3|25|30|
{{/chart}}

Children Macro

The Children macro lists the child pages of the current page.

Code Macro

The Code macro highlights and formats source code.

public class Hello {
   public static void main(String[] args) {
        System.out.println("Hello World");
   }
}
{{code language="java"}}
public class Hello {
    public static void main(String[] args) {
        System.out.println("Hello World");
    }
}
{{/code}}

Comment Macro

The Comment macro hides content from page rendering.

Visible part 1.

Visible part 2.

Visible part 1.
{{comment}}This text will not be visible.{{/comment}}
Visible part 2.

Container Macro

The Container macro creates multi-column layouts.

Column 1: This is the first column.

Column 2: This is the second column.

{{container layoutStyle="columns"}}
(((**Column 1:** This is the first column.)))
(((**Column 2:** This is the second column.)))
{{/container}}

Dashboard Macro

The Dashboard macro creates areas for gadgets.

{{dashboard columns="2"/}}

Display Macro

The Display macro embeds content from another page.

{{display page="Help.Macros"/}}

DisplayIcon Macro

The DisplayIcon macro displays an icon.

 Home

{{displayIcon name="home"/}} Home

Documents Macro

The Documents macro shows a livetable of documents.

{{documents space="MySpace"/}}

DocumentTree Macro

The DocumentTree macro shows a collapsible page tree.

Footnote Macro

The Footnote macro adds footnotes to the page.

This is a statementSource: Example Reference.
The [putFootnotes] macro is a standalone macro and it cannot be used inline. Click on this message for details.

This is a statement{{footnote}}Source: Example Reference{{/footnote}}.
{{putFootnotes/}}

PutFootnotes Macro

The PutFootnotes macro outputs collected footnotes.

...page content...
The [putFootnotes] macro is a standalone macro and it cannot be used inline. Click on this message for details.

...page content...
{{putFootnotes/}}

Gallery Macro

The Gallery macro displays a collection of images.

{{gallery}}
image:Space.Page@Image1.png
image:Space.Page@Image2.png
{{/gallery}}

Groovy Macro

The Groovy macro executes Groovy scripts.

Failed to execute the [groovy] macro. Cause: [The execution of the [groovy] script macro is not allowed in [xwiki:MyWiki.WebHome]. Check the rights of its last author or the parameters if it's rendered from another script.]. Click on this message for details.

{{groovy}}
println("Hello from Groovy!")
{{/groovy}}

HTML Macro

The HTML macro embeds raw HTML into pages.

This is red text via HTML.

{{html}}
<p style="color:red;">This is red text via HTML.</p>
{{/html}}

Id Macro

The Id macro defines an internal link anchor.

Click here to jump.


Target Location: You have reached the target.

Click [[here>>#myanchor]] to jump.

{{id name="myanchor"/}}
**Target Location:** You have reached the target.

Include Macro

The Include macro includes another page's content.

{{include page="Help.Introduction"/}}

Mention Macro

The Mention macro notifies a mentioned user.

Failed to execute the [mention] macro. Cause: [Parameter [reference] is mandatory]. Click on this message for details.

{{mention user="xwiki:JohnDoe"/}}

Notifications Macro

The Notifications macro displays recent activity.

edited by Ryan CRyan C
1 day ago
{{notifications/}}

Office Macro

The Office macro displays Office documents.

Failed to execute the [office] macro. Cause: [The wiki needs to be connected to an office server in order to view office files. Ask your administrator to configure such a server.]. Click on this message for details.

{{office attachment="Main.UserGuide@Guide.docx"/}}

Python Macro

The Python macro executes Python scripts.

Failed to execute the [python] macro. Cause: [You need Programming Rights to execute the script macro [python]]. Click on this message for details.

{{python}}
print("Hello from Python!")
{{/python}}

Script Macro

The Script macro executes scripts in different languages.

Failed to execute the [script] macro. Cause: [The execution of the [script] script macro is not allowed in [xwiki:MyWiki.WebHome]. Check the rights of its last author or the parameters if it's rendered from another script.]. Click on this message for details.

{{script language="velocity"}}
#set($name = "Velocity")
Hello $name!
{{/script}}

Tag Cloud Macro

The Tag Cloud macro displays tags visually.

No page has been tagged yet

{{tagcloud/}}

User Avatar Macro

The User Avatar macro shows a user's avatar image.

Invalid macro parameters used for the [useravatar] macro. Cause: [Property [username] mandatory]. Click on this message for details.

{{useravatar user="xwiki:JohnDoe"/}}

Velocity Macro

The Velocity macro executes Velocity scripts.

Failed to execute the [velocity] macro. Cause: [The execution of the [velocity] script macro is not allowed in [xwiki:MyWiki.WebHome]. Check the rights of its last author or the parameters if it's rendered from another script.]. Click on this message for details.

{{velocity}}
#set($name = "Alice")
Hello $name!
{{/velocity}}

Menu Macro

The Menu macro builds a navigation menu.

Unknown macro: menu. Click on this message for details.

{{menu}}
* [[Home>>Main.WebHome]]
* [[Products>>Main.Products]]
** [[Product A>>Main.Products.ProductA]]
** [[Product B>>Main.Products.ProductB]]
* [[Contact>>Main.Contact]]
{{/menu}}