Hide last authors
author | version | line-number | content |
---|---|---|---|
![]() |
10.1 | 1 | = XWiki Macros Reference Guide = |
![]() |
9.1 | 2 | |
3 | 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. | ||
4 | |||
5 | |||
![]() |
10.1 | 6 | == TOC Macro == |
![]() |
9.1 | 7 | |
![]() |
10.1 | 8 | The **TOC** macro generates a Table of Contents. |
![]() |
9.1 | 9 | |
![]() |
10.1 | 10 | {{example}} |
11 | {{toc/}} | ||
12 | {{/example}} | ||
![]() |
9.1 | 13 | |
![]() |
10.1 | 14 | == Box Macro == |
![]() |
9.1 | 15 | |
![]() |
10.1 | 16 | 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. |
![]() |
9.1 | 17 | |
![]() |
10.1 | 18 | {{example}} |
19 | {{box title="Note"}} | ||
20 | This is a sample box message. | ||
21 | {{/box}} | ||
22 | {{/example}} | ||
![]() |
9.1 | 23 | |
![]() |
10.1 | 24 | == Info Macro == |
![]() |
9.1 | 25 | |
![]() |
10.1 | 26 | The **Info** macro displays an informational message in a styled box. It is typically rendered with a blue color to denote general information. |
![]() |
9.1 | 27 | |
![]() |
10.1 | 28 | {{example}} |
29 | {{info}} | ||
![]() |
9.1 | 30 | This is an informational message. |
![]() |
10.1 | 31 | {{/info}} |
32 | {{/example}} | ||
![]() |
9.1 | 33 | |
![]() |
10.1 | 34 | {{example}} |
35 | {{info title="FYI"}} | ||
36 | This is an informational message with a title. | ||
37 | {{/info}} | ||
38 | {{/example}} | ||
![]() |
9.1 | 39 | |
![]() |
10.1 | 40 | == Warning Macro == |
![]() |
9.1 | 41 | |
![]() |
10.1 | 42 | The **Warning** macro highlights a warning message in a styled box (yellow/orange background). |
![]() |
9.1 | 43 | |
![]() |
10.1 | 44 | {{example}} |
45 | {{warning}} | ||
![]() |
9.1 | 46 | This is a warning message. |
![]() |
10.1 | 47 | {{/warning}} |
48 | {{/example}} | ||
![]() |
9.1 | 49 | |
![]() |
10.1 | 50 | == Success Macro == |
![]() |
9.1 | 51 | |
![]() |
10.1 | 52 | The **Success** macro displays a success message in a green-styled box. |
![]() |
9.1 | 53 | |
![]() |
10.1 | 54 | {{example}} |
55 | {{success}} | ||
![]() |
9.1 | 56 | This is a success message. |
![]() |
10.1 | 57 | {{/success}} |
58 | {{/example}} | ||
![]() |
9.1 | 59 | |
![]() |
10.1 | 60 | == Error Macro == |
![]() |
9.1 | 61 | |
![]() |
10.1 | 62 | The **Error** macro displays a critical error or alert message in a red-styled box. |
![]() |
9.1 | 63 | |
![]() |
10.1 | 64 | {{example}} |
65 | {{error}} | ||
![]() |
9.1 | 66 | This is an error message. |
![]() |
10.1 | 67 | {{/error}} |
68 | {{/example}} | ||
![]() |
9.1 | 69 | |
![]() |
10.1 | 70 | == Chart Macro == |
![]() |
9.1 | 71 | |
![]() |
10.1 | 72 | The **Chart** macro generates graphical charts based on input tables. |
![]() |
9.1 | 73 | |
![]() |
10.1 | 74 | {{example}} |
75 | {{chart type="pie" source="inline" params="range:B2-B4;series:columns;" width="400" height="300"}} | ||
76 | |=Category|=Value| | ||
77 | |A|10| | ||
78 | |B|20| | ||
79 | |C|30| | ||
80 | {{/chart}} | ||
81 | {{/example}} | ||
![]() |
9.1 | 82 | |
![]() |
10.1 | 83 | {{example}} |
84 | {{chart type="bar" source="inline" params="range:B2-C4;series:columns;" width="500" height="300"}} | ||
85 | |=Quarter|=Product X|=Product Y| | ||
86 | |Q1|20|15| | ||
87 | |Q2|30|25| | ||
88 | |Q3|25|30| | ||
89 | {{/chart}} | ||
90 | {{/example}} | ||
![]() |
9.1 | 91 | |
![]() |
10.1 | 92 | == Children Macro == |
![]() |
9.1 | 93 | |
![]() |
10.1 | 94 | The **Children** macro lists the child pages of the current page. |
![]() |
9.1 | 95 | |
![]() |
10.1 | 96 | {{example}} |
![]() |
9.1 | 97 | {{children/}} |
![]() |
10.1 | 98 | {{/example}} |
![]() |
9.1 | 99 | |
![]() |
10.1 | 100 | == Code Macro == |
![]() |
9.1 | 101 | |
![]() |
10.1 | 102 | The **Code** macro highlights and formats source code. |
![]() |
9.1 | 103 | |
![]() |
10.1 | 104 | {{example}} |
105 | {{code language="java"}} | ||
106 | public class Hello { | ||
107 | public static void main(String[] args) { | ||
108 | System.out.println("Hello World"); | ||
109 | } | ||
110 | } | ||
![]() |
9.1 | 111 | {{/code}} |
![]() |
10.1 | 112 | {{/example}} |
![]() |
9.1 | 113 | |
![]() |
10.1 | 114 | == Comment Macro == |
![]() |
9.1 | 115 | |
![]() |
10.1 | 116 | The **Comment** macro hides content from page rendering. |
![]() |
9.1 | 117 | |
![]() |
10.1 | 118 | {{example}} |
119 | Visible part 1. | ||
120 | {{comment}}This text will not be visible.{{/comment}} | ||
121 | Visible part 2. | ||
122 | {{/example}} | ||
![]() |
9.1 | 123 | |
![]() |
10.1 | 124 | == Container Macro == |
![]() |
9.1 | 125 | |
![]() |
10.1 | 126 | The **Container** macro creates multi-column layouts. |
![]() |
9.1 | 127 | |
![]() |
10.1 | 128 | {{example}} |
129 | {{container layoutStyle="columns"}} | ||
130 | (((**Column 1:** This is the first column.))) | ||
131 | (((**Column 2:** This is the second column.))) | ||
132 | {{/container}} | ||
133 | {{/example}} | ||
![]() |
9.1 | 134 | |
![]() |
10.1 | 135 | == Dashboard Macro == |
![]() |
9.1 | 136 | |
![]() |
10.1 | 137 | The **Dashboard** macro creates areas for gadgets. |
![]() |
9.1 | 138 | |
![]() |
10.1 | 139 | {{example}} |
![]() |
9.1 | 140 | {{dashboard columns="2"/}} |
![]() |
10.1 | 141 | {{/example}} |
![]() |
9.1 | 142 | |
![]() |
10.1 | 143 | == Display Macro == |
![]() |
9.1 | 144 | |
![]() |
10.1 | 145 | The **Display** macro embeds content from another page. |
![]() |
9.1 | 146 | |
![]() |
10.1 | 147 | {{example}} |
![]() |
9.1 | 148 | {{display page="Help.Macros"/}} |
![]() |
10.1 | 149 | {{/example}} |
![]() |
9.1 | 150 | |
![]() |
10.1 | 151 | == DisplayIcon Macro == |
![]() |
9.1 | 152 | |
![]() |
10.1 | 153 | The **DisplayIcon** macro displays an icon. |
![]() |
9.1 | 154 | |
![]() |
10.1 | 155 | {{example}} |
![]() |
9.1 | 156 | {{displayIcon name="home"/}} Home |
![]() |
10.1 | 157 | {{/example}} |
![]() |
9.1 | 158 | |
![]() |
10.1 | 159 | == Documents Macro == |
![]() |
9.1 | 160 | |
![]() |
10.1 | 161 | The **Documents** macro shows a livetable of documents. |
![]() |
9.1 | 162 | |
![]() |
10.1 | 163 | {{example}} |
![]() |
9.1 | 164 | {{documents space="MySpace"/}} |
![]() |
10.1 | 165 | {{/example}} |
![]() |
9.1 | 166 | |
![]() |
10.1 | 167 | == DocumentTree Macro == |
![]() |
9.1 | 168 | |
![]() |
10.1 | 169 | The **DocumentTree** macro shows a collapsible page tree. |
![]() |
9.1 | 170 | |
![]() |
10.1 | 171 | {{example}} |
![]() |
9.1 | 172 | {{documentTree reference="Help.WebHome"/}} |
![]() |
10.1 | 173 | {{/example}} |
![]() |
9.1 | 174 | |
![]() |
10.1 | 175 | == Footnote Macro == |
![]() |
9.1 | 176 | |
![]() |
10.1 | 177 | The **Footnote** macro adds footnotes to the page. |
![]() |
9.1 | 178 | |
![]() |
10.1 | 179 | {{example}} |
180 | This is a statement{{footnote}}Source: Example Reference{{/footnote}}. | ||
181 | {{putFootnotes/}} | ||
182 | {{/example}} | ||
![]() |
9.1 | 183 | |
![]() |
10.1 | 184 | == PutFootnotes Macro == |
![]() |
9.1 | 185 | |
![]() |
10.1 | 186 | The **PutFootnotes** macro outputs collected footnotes. |
![]() |
9.1 | 187 | |
![]() |
10.1 | 188 | {{example}} |
189 | ...page content... | ||
190 | {{putFootnotes/}} | ||
191 | {{/example}} | ||
![]() |
9.1 | 192 | |
![]() |
10.1 | 193 | == Gallery Macro == |
![]() |
9.1 | 194 | |
![]() |
10.1 | 195 | The **Gallery** macro displays a collection of images. |
![]() |
9.1 | 196 | |
![]() |
10.1 | 197 | {{example}} |
198 | {{gallery}} | ||
199 | image:Space.Page@Image1.png | ||
200 | image:Space.Page@Image2.png | ||
201 | {{/gallery}} | ||
202 | {{/example}} | ||
![]() |
9.1 | 203 | |
![]() |
10.1 | 204 | == Groovy Macro == |
![]() |
9.1 | 205 | |
![]() |
10.1 | 206 | The **Groovy** macro executes Groovy scripts. |
![]() |
9.1 | 207 | |
![]() |
10.1 | 208 | {{example}} |
209 | {{groovy}} | ||
210 | println("Hello from Groovy!") | ||
211 | {{/groovy}} | ||
212 | {{/example}} | ||
![]() |
9.1 | 213 | |
![]() |
10.1 | 214 | == HTML Macro == |
![]() |
9.1 | 215 | |
![]() |
10.1 | 216 | The **HTML** macro embeds raw HTML into pages. |
![]() |
9.1 | 217 | |
![]() |
10.1 | 218 | {{example}} |
219 | {{html}} | ||
220 | <p style="color:red;">This is red text via HTML.</p> | ||
221 | {{/html}} | ||
222 | {{/example}} | ||
![]() |
9.1 | 223 | |
![]() |
10.1 | 224 | == Id Macro == |
![]() |
9.1 | 225 | |
![]() |
10.1 | 226 | The **Id** macro defines an internal link anchor. |
![]() |
9.1 | 227 | |
![]() |
10.1 | 228 | {{example}} |
229 | Click [[here>>#myanchor]] to jump. | ||
![]() |
9.1 | 230 | |
![]() |
10.1 | 231 | {{id name="myanchor"/}} |
232 | **Target Location:** You have reached the target. | ||
233 | {{/example}} | ||
![]() |
9.1 | 234 | |
![]() |
10.1 | 235 | == Include Macro == |
![]() |
9.1 | 236 | |
![]() |
10.1 | 237 | The **Include** macro includes another page's content. |
![]() |
9.1 | 238 | |
![]() |
10.1 | 239 | {{example}} |
![]() |
9.1 | 240 | {{include page="Help.Introduction"/}} |
![]() |
10.1 | 241 | {{/example}} |
![]() |
9.1 | 242 | |
![]() |
10.1 | 243 | == Mention Macro == |
![]() |
9.1 | 244 | |
![]() |
10.1 | 245 | The **Mention** macro notifies a mentioned user. |
![]() |
9.1 | 246 | |
![]() |
10.1 | 247 | {{example}} |
![]() |
9.1 | 248 | {{mention user="xwiki:JohnDoe"/}} |
![]() |
10.1 | 249 | {{/example}} |
![]() |
9.1 | 250 | |
![]() |
10.1 | 251 | == Notifications Macro == |
![]() |
9.1 | 252 | |
![]() |
10.1 | 253 | The **Notifications** macro displays recent activity. |
![]() |
9.1 | 254 | |
![]() |
10.1 | 255 | {{example}} |
![]() |
9.1 | 256 | {{notifications/}} |
![]() |
10.1 | 257 | {{/example}} |
![]() |
9.1 | 258 | |
![]() |
10.1 | 259 | == Office Macro == |
![]() |
9.1 | 260 | |
![]() |
10.1 | 261 | The **Office** macro displays Office documents. |
![]() |
9.1 | 262 | |
![]() |
10.1 | 263 | {{example}} |
![]() |
9.1 | 264 | {{office attachment="Main.UserGuide@Guide.docx"/}} |
![]() |
10.1 | 265 | {{/example}} |
![]() |
9.1 | 266 | |
![]() |
10.1 | 267 | == Python Macro == |
![]() |
9.1 | 268 | |
![]() |
10.1 | 269 | The **Python** macro executes Python scripts. |
![]() |
9.1 | 270 | |
![]() |
10.1 | 271 | {{example}} |
272 | {{python}} | ||
273 | print("Hello from Python!") | ||
274 | {{/python}} | ||
275 | {{/example}} | ||
![]() |
9.1 | 276 | |
![]() |
10.1 | 277 | == Script Macro == |
![]() |
9.1 | 278 | |
![]() |
10.1 | 279 | The **Script** macro executes scripts in different languages. |
![]() |
9.1 | 280 | |
![]() |
10.1 | 281 | {{example}} |
282 | {{script language="velocity"}} | ||
283 | #set($name = "Velocity") | ||
284 | Hello $name! | ||
285 | {{/script}} | ||
286 | {{/example}} | ||
![]() |
9.1 | 287 | |
![]() |
10.1 | 288 | == Tag Cloud Macro == |
![]() |
9.1 | 289 | |
![]() |
10.1 | 290 | The **Tag Cloud** macro displays tags visually. |
![]() |
9.1 | 291 | |
![]() |
10.1 | 292 | {{example}} |
![]() |
9.1 | 293 | {{tagcloud/}} |
![]() |
10.1 | 294 | {{/example}} |
![]() |
9.1 | 295 | |
![]() |
10.1 | 296 | == User Avatar Macro == |
![]() |
9.1 | 297 | |
![]() |
10.1 | 298 | The **User Avatar** macro shows a user's avatar image. |
![]() |
9.1 | 299 | |
![]() |
10.1 | 300 | {{example}} |
301 | {{useravatar user="xwiki:JohnDoe"/}} | ||
302 | {{/example}} | ||
![]() |
9.1 | 303 | |
![]() |
10.1 | 304 | == Velocity Macro == |
![]() |
9.1 | 305 | |
![]() |
10.1 | 306 | The **Velocity** macro executes Velocity scripts. |
![]() |
9.1 | 307 | |
![]() |
10.1 | 308 | {{example}} |
309 | {{velocity}} | ||
310 | #set($name = "Alice") | ||
311 | Hello $name! | ||
312 | {{/velocity}} | ||
313 | {{/example}} | ||
![]() |
9.1 | 314 | |
![]() |
10.1 | 315 | == Menu Macro == |
![]() |
9.1 | 316 | |
![]() |
10.1 | 317 | The **Menu** macro builds a navigation menu. |
![]() |
9.1 | 318 | |
![]() |
10.1 | 319 | {{example}} |
320 | {{menu}} | ||
321 | * [[Home>>Main.WebHome]] | ||
322 | * [[Products>>Main.Products]] | ||
323 | ** [[Product A>>Main.Products.ProductA]] | ||
324 | ** [[Product B>>Main.Products.ProductB]] | ||
325 | * [[Contact>>Main.Contact]] | ||
326 | {{/menu}} | ||
327 | {{/example}} | ||
![]() |
9.1 | 328 | |
329 |