Nuxeo Server

Document Layouts

Updated: December 12, 2017 Page Information Edit on GitHub

Layouts can be linked to a document type by specifying the layout names in its definition.

Here is a sample configuration excerpt:

<type id="Note">
  [...]
  <layouts mode="any">
    <layout>heading</layout>
    <layout>note</layout>
  </layouts>
</type>

Layouts are defined in a given mode; layouts in the "any" mode will be used as default when no layouts are given in specific modes.

It is possible to merge layouts when redefining the document type, adding a property append="true":

<layouts mode="any" append="true">
  <layout>newLayout</layout>
</layouts>

The property named display set on the layout configuration is enough to handle a two columns rendering, it can be set to value table_2_columns for this purpose.

Document Layouts Display

The documentLayout tag can be used to display the layouts of a document:

<div xmlns="http://www.w3.org/1999/xhtml"
    xmlns:nxl="http://nuxeo.org/nxforms/layout">
  <nxl:documentLayout mode="view" value="#{currentDocument}" />
</div>

It is possible to make a distinction between the layouts defined in a given mode on the document, and the mode used to render layouts, for instance:

<nxl:documentLayout
  documentMode="header"
  mode="view"
  value="#{currentDocument}"
  defaultLayout="document_header"
  includeAnyMode="false" />

It is also possible to define a fallback mode on documents, for instance when retrieving layouts for document mode driveEdit, if no layout is resolved, it can fallback to layouts defined for document mode edit:

<nxl:documentLayout
  documentMode="edit"
  documentModeFallback="driveEdit"
  mode="view"
  value="#{currentDocument}" />
6 hours ago Manon Lumeau add tags for doc days
a month ago manonlumeau Added content-review-lts2017 label
2 months ago manonlumeau NXDOC-1346-FT review screenshot
3 years ago Anahide Tchertchian 12 | XDOC-427: document fallback on document layout mode ta
3 years ago Solen Guitter 11 | Remove 5.4 references
4 years ago Solen Guitter 10 | formatting
4 years ago Solen Guitter 9 | Removed mentions to 5.4.2 and older versions
4 years ago Anahide Tchertchian 8 | better sample conf
4 years ago Anahide Tchertchian 7 | add anchor for display
4 years ago Anahide Tchertchian 6 | update + add document layout tags
4 years ago Anahide Tchertchian 5 | better title
4 years ago Solen Guitter 4
7 years ago Anahide Tchertchian 2
7 years ago Anahide Tchertchian 3 | Migrated to Confluence 4.0
7 years ago Anahide Tchertchian 1
History: Created by Anahide Tchertchian