Tips and tricks

Break headers in multiple lines

In wiki, a header is a single line starting with ---+. The moment you press enter key and create a new line, you also stop the header. In order to split a header in multiple lines, use the %BR% macro. %BR% generates a new line, but continues the same line as for wiki processor.

The wiki text

[block(center)]
---+++Centered header%BR%with multiple%BR%lines
[/block]

Will compile into

Centered header
with multiple
lines

List element with multiple lines

Lists are represented by one or more spaces followed by * or 1. As it happen with headers, list elements use a single line. You can split the line into multiple lines using the %BR% macro.

The wiki text

 * **A list element**%BR%With some description...
 * **A second element**%BR%With some more description attached...

Will compile into

  • A list element
    With some description...
  • A second element
    With some more description attached...

Conditional visibility

By using macros, you can control elements visibility. We'll use two macros, {@user} and {@equals}. The first one will check if current user id is blank, in which case no user is authenticated. The second macro will expand to none when user id is blank, and to blank otherwise.

The wiki text

[block(display:{@equals:{@user:id}::none: })]
Hello {@user:name}!
[/block]

The statement the equals macro aims to resolve is: if user id is blank, write none, otherwise write one space. Read more about the equals macro in Generic .

Will compile into, visible only when authenticated

Hello !

If you're an unauthenticated visitor, you'll be able to see the invisible block by inspecting the element.
Printer version
English01/11/18 11:21Lluís Turró Cutiller
English02/07/18 11:03Lluís Turró Cutiller