Container Macro

Version 14.2 by Sergiu Dumitriu on 2011/11/02 07:48

cogLays out wiki content
TypeJAR
Category
Developed byUnknown
Rating
1 Votes
LicenseGNU Lesser General Public License 2.1

Description

For now, the only implemented decoration is the layout, and in particular the columns layout.

Usage

Use the container macro to define the layout and put the content to be layouted inside the container macro. For example, to layout content in columns, add a wiki group for each column inside the container macro, as in this example (for 2 columns).

{{container layoutStyle="columns"}}
(((first column)))
(((second column)))
{{/container}}

Note that inside the column groups you can add any wiki content. For example, the following result can be achieved (a 2 columns layout, with wiki content in the columns):

columns.png

Parameter definition

NameOptionalAllowed valuesDefault valueDescription
layoutStyleyesany string, only 'columns' is implemented by default, for time beingnoneThe layout to use for the content grouped by the container macro. If missing or a non-implemented value is passed, no layout is applied, the content of the container macro is just rendered as if the macro was not there.
justifyyesboolean (true/false)falseWhether the content in the container is justified or not (for the columns layout, it specify if the columns are be justified or not).

For developers

You can easily implement your own layout style to be used with the container macro, by implementing the LayoutManager interface as a component, and dropping your implementation in the classpath (WEB-INF/lib of your wiki installation). The hint of your component will be the name of the layout style to pass to the container macro.
For example:

@Component("grid")
public class GridLayoutManager implements LayoutManager
{
 ...
}

which can then be used in a wiki page by writing:

{{container layoutManager="grid"}}
your defined wiki content for the grid layout goes here
{{/container}}

Get Connected