Export tools macros

Last modified by Admin on 2026/02/26 15:45

cogSet of macros to impact the result when doing a XWiki pages export.
TypeXAR
CategoryMacro
Developed by

Josué Tille

Rating
0 Votes
LicenseGNU Lesser General Public License 2.1

Success

Installable with the Extension Manager

Description

Set of macros to impact the result when doing a XWiki pages export. This could be useful by example on PDF or ODT export to adapt the content in theses cases.

This extension contains 5 macros:

  • export-ignore: which will hide the macro content on the export
  • export-only: which will show the macro content only on the export
  • Export tools 1.1.0+ export-pagetitle : Override the cover title of the exported document.
  • Export tools 1.2.0+ export-pagebreak : Create a page break at the place of the macro.
  • Export tools 1.3.0+ export-tablelayout : Customize the table when exported.

Usage

{{export-ignore}}
my content which will be hidden on the export...
{{/export-ignore}}

{{export-only}}
my content which will be shown only on the export...
{{/export-only}}

{{export-pagetitle}}
The custom cover title
{{/export-pagetitle}}

Content before page break...

{{export-pagebreak/}}

Content after page break...

{{export-tablelayout widths="50%,25%,25%"/}}

|Collumn 1|Col 2|Col 3
|Size with 50%|Size with 25%|Size with 25%

Feature support

Depending of the macro and the export type the macro feature could be not supported. Here are a summary of the support:

Macro name PDF export support ODF/RTF export supportHTML  export support
export-ignoreYesYesYes, the macro content won't be in the output HTML
export-onlyYesYesYes, the macro content will be in the output HTML
export-pagetitleYes (need to use the "Export tools template"). In case of multiple page export, the name will be taken from the root page of the exported space.NoNo
export-pagebreakYes (need to use the "Export tools template").NoNo
export-tablelayoutYes (see Table layout section for more details)NoYes (The table widths parameter will be taken into account)

PDF Template

To have some macros working correctly you will need to use a specific PDF template provided by this extension. To use this template you will need to:

Table layout

Currently this macro only have one parameter to set the size of each columns. The parameter widths accept 2 type of value:

  • The relative value. By example widths="2*,1*,1*,1*. In this case the resulting table in the export would have a first column which is double the width of the 3 remaining equally width columns.
  • The percent value. By example widths="25%,25%,25%,25%". The resulting table in the export would then have 4-equal column widths.

Note that the macro does not contain any content. Instead, it applies to the table below the macro.

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 following manual method, which is useful if this extension cannot be installed with the Extension Manager or if you're using an old version of XWiki that doesn't have the Extension Manager:

  1. Log in the wiki with a user having Administration rights
  2. Go to the Administration page and select the Import category
  3. Follow the on-screen instructions to upload the downloaded XAR
  4. Click on the uploaded XAR and follow the instructions
  5. You'll also need to install all dependent Extensions that are not already installed in your wiki

Versions

Dependencies

Dependencies for this extension (org.xwiki.contrib.export-tools:export-tools-macro-ui 1.3.2):

Get Connected