Add settings or information to the information docextra tab

Usage

The content of the information docextra tab that is displayed below the page content as well as in the information viewer is based on extensions of this extension point. This can be used to both display additional information/links as well as additional settings, as shown in the following screenshot with the activation status of heading numbering:

InformationDocextra-with-Heading-Numbering.png

Definition

This Extension Point is contributed by this extension and was added in version 14.0-rc-1 of that extension.

Category
Page Layout
Extension Id
org.xwiki.platform.template.information
Content to be provided

At least one <dt>-element and as many <dd>-elements as desired such that its content can be used as part of a definition list in the vertical form layout. Note that this means that the HTML macro with the clean parameter set to false must be used.

Parameters to be provided
  • order: The order in which the item will be displayed. The default is to display the items in two columns, with extensions with order less than 1000 being displayed in the left column and extensions with order greater than or equal to 1000 being displayed in the right column. This could be overridden by the skin, though. The default extensions use orders 100, 200, 300, 400, 500 for the left and 1100, 1200, 1300 for the right column.

Example

Example for displaying the heading numbering activation status:

{{template name="display_macros.vm" /}}

{{velocity}}

{{html clean="false"}}
      <dt#if ($hasEdit) class="editableProperty"#end data-property="NumberedHeadings.Code.NumberedHeadingsClass[0].status"
     data-property-type="object" data-object-policy="updateOrCreate">
        <label for="NumberedHeadings.Code.NumberedHeadingsClass_0_status">$escapetool.xml($services.localization.render('numbered.headings.activationUI.label'))</label>
      </dt>
      #createObjectAndPropertyIfMissing('NumberedHeadings.Code.NumberedHeadingsClass[0].status')
      <dd>#displayObjectProperty('NumberedHeadings.Code.NumberedHeadingsClass[0].status' 'view')</dd>
{{/html}}
{{/velocity}}

This also demonstrates how the #createObjectAndPropertyIfMissing-macro is used to create a new object such that we can then display the property. Further, an editable property is used with the data-object-policy="updateOrCreate" such that the object is created when the property is saved.

In the screenshot above, this is combined with the order=850 parameter to display the setting in the left column but below the other settings.

Tags:
   

Get Connected