Document Accordion Macro

Last modified by Mohamed Boussaa on 2017/09/25 00:00

cogRendering macro for displaying multiple documents as an accordion
Developed by

Mohamed Boussaa

Active Installs8
0 Votes
LicenseGNU Lesser General Public License 2.1
Installable with the Extension Manager


Rendering macro for displaying multiple documents as an accordion


Select the entries of a AWM application

{{docaccordion space="MyApp"/}}

Select blog posts available on a given space

{{docaccordion xclass="Blog.BlogPostClass" space="MyBlog" sort="ALPHA" openFirstAccordion="true" displayAuthor="false" displayDate="false" accordionMaxHeight="300" limit="100"/}}

Parameters definition

NameOptionalAllowed valuesDefault valueDescription
xclassyesa document reference Limit the selection to documents containing objects instance of this XClass (not mandatory, at least xclass or space mandatory)
spaceyesa document reference If the xclass parameter is set: limit the selection to this page and its children (The space parameter is used as a filter)
If the xclass parameter is not set: the space parameter must be an Application Within Minutes, in this case the macro will display items of that application.
sortyesCHRONO, ALPHACHRONOSort the available documents chronologically or alphabetically.
openFirstAccordionyestrue, flasetrueShow first accordions.
displayAuthoryestrue, flasetrueDisplay the document author.
displayDateyestrue, falsetrueDisplay the document last modification date.
accordionMaxHeightyesinteger0The maximum height (in px) that an accordion use to display the document content. To avoid scrollbars use zero for an unlimited height.
limityesinteger100Limit the number of accordions that could be displayed.

Known issues

There is a bug in CKEditor Integration 1.10 and lower that breaks the translations on the Wysiwyg macro editor popoup. To fix the issue you need to upgrade CKEditor Integration to version >=1.12


Screenshots of using the macro in the WYSIWYG editor.

Select the macro on the Wysiwyg

Doc Accordion Macro on the Wysiwyg macro editor

Doc Accordion Macro - More parameters

Doc Accordion Macro results display

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). Note that installing Extensions when being offline is currently not supported and you'd need to use some complex manual method.

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.

Release Notes


First version


Dependencies for this extension (org.xwiki.contrib:macro-docaccordion 1.0):

Created by Mohamed Boussaa on 2017/06/06 10:53

Get Connected