Container Macro
Arrange and decorate its contents according to the parameters |
Type | JAR |
Category | |
Developed by | |
Active Installs | 8 |
Rating | |
License | GNU Lesser General Public License 2.1 |
Bundled With | XWiki Standard |
Compatibility | XWiki Platform >= 2.5M2 |
Table of contents
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).
(((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):
Parameter definition
Name | Optional | Allowed values | Default value | Description |
---|---|---|---|---|
layoutStyle | yes | any string, only 'columns' is implemented by default, for time being | none | The 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. |
justify | yes | boolean (true/false) | false | Whether 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:
public class GridLayoutManager implements LayoutManager
{
...
}
which can then be used in a wiki page by writing:
your defined wiki content for the grid layout goes here
{{/container}}
Prerequisites & Installation Instructions
We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager).
You can also use the manual method which involves dropping the JAR file and all its dependencies into the WEB-INF/lib folder and restarting XWiki.
Dependencies
Dependencies for this extension (org.xwiki.platform:xwiki-platform-rendering-macro-container 16.9.0):
- org.xwiki.commons:xwiki-commons-xml 16.9.0
- org.xwiki.platform:xwiki-platform-skin-api 16.9.0
- org.xwiki.rendering:xwiki-rendering-api 16.9.0
- org.xwiki.rendering:xwiki-rendering-transformation-macro 16.9.0