Include Macro

Version 41.12 by Ludovic Dubost on 2019/09/20 17:34

cogInclude an entity (document, property, etc.)
TypeJAR
Category
Developed by

XWiki Development Team

Active Installs0
Rating
0 Votes
LicenseGNU Lesser General Public License 2.1
Bundled With

XWiki Enterprise, XWiki Enterprise Manager

Installable with the Extension Manager

Description

Include other pages into the current page. By default this macro includes the content in the context of the current page. For an include of content use display macro.

Usage

From WYSIWYG Editor

includeMacro-wysiwygEditor.png

From Wiki Syntax

{{include page="page1/page2"/}}

Parameters definition

NameOptionalAllowed valuesDefault valueDescription
pageno or referencea page reference since 10.6 the reference of the page to include. You should use this parameter rather than the reference one which is more complex to use.
referenceno or pagean entity reference the reference of the entity to include. See the Model module to understand the concept of references.
typeyesdocumentdocumentthe type of the entity. This parameter is also only useful when used with the reference parameter. It's not needed when using the page parameter.
sectionyesstringthe anchor to the Heading section to include in the target document (note that headings generate anchors automatically in the form: "H" + heading title stripped of all non alpha characters).
documentnoa wiki document the name of the document to include. Deprecated since 3.4M1. Use page (or reference) instead.
contextyesnew/currentcurrentdefines whether the included page is executed in its separated execution context or whether it's executed in the context of the current page. Deprecated since 3.4M1. Use display macro for context=new.

Example

Example 1:

{{include page="Page1/Page2"/}}

Example 2 (if you want to include a page from another wiki):

{{include page="somewiki:Page1/Page2"/}}

Example 3:

{{include page="Page1/Page2" section="HMySection"/}}

Example 4 (using the reference parameter):

{{include reference="Page1.Page2.WebHome" /}}

NOTE: Be sure to include the / within the "/}} at the end, otherwise any content that comes after the included section on this page will fail to appear.

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-include 11.7):

Tags: include
    

Get Connected