All Nuxeo Platform documentation versions

Nuxeo Platform 5.6
Nuxeo Platform 5.5
Nuxeo Enterprise Platform (EP) 5.4
Nuxeo Enterprise Platform (EP) 5.3

Nuxeo Platform Dev version (unreleased)

This documentation refers to the unreleased development version of the Nuxeo Platform. For the current production version, refer to the 5.6 documentation.

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added related pages

How to add a new widget to the default summary layout?

Info

This how-to defines how things should be done from version 5.6. For earlier versions, the whole summary layout needs to be redefined.

...

Here is the definition of the widget referencing actions for the "SUMMARY_TOP_LEFT" category:

Code Block
xml
<extension target="org.nuxeo.ecm.platform.forms.layout.WebLayoutManager"
  point="widgets">

  <widget name="summary_actions_top_left" type="summary_current_document_custom_actions">
    <labels>
      <label mode="any"></label>
    </labels>
    <properties widgetMode="any">
      <property name="category">SUMMARY_TOP_LEFT</property>
      <property name="subStyleClass">summaryActions</property>
    </properties>
  </widget>

</extension>

Default widgets (presenting the document relations, status, publications, etc...) are either contributed to one of these zones, either already added to the layout between these widgets. For instance, here is the definition of the widget placed in the left panel of the summary layout:

Code Block
xml
<extension target="org.nuxeo.ecm.platform.forms.layout.WebLayoutManager"
  point="widgets">

  <widget name="summary_left_panel" type="container">
    <handlingLabels>true</handlingLabels>
    <labels>
      <label mode="any"></label>
    </labels>
    <translated>false</translated>
    <properties widgetMode="any">
      <property name="hideSubLabels">true</property>
    </properties>
    <subWidgetRefs>
      <widget>summary_actions_top_left</widget>
      <widget>summary_current_document_comments</widget>
      <widget>summary_current_document_publications</widget>
      <widget>summary_current_document_single_tasks</widget>
      <widget>summary_actions_bottom_left</widget>
    </subWidgetRefs>
  </widget>

</extension>

Here is a sample contribution to add a widget to the top left widget:

Code Block
xml
<extension target="org.nuxeo.ecm.platform.forms.layout.WebLayoutManager"
  point="widgets">

  <widget name="summary_note_text" type="richtext_with_mimetype">
    <fields>
      <field>note:note</field>
      <field>note:mime_type</field>
    </fields>
    <properties mode="view">
      <property name="translatedHtml">
        #{noteActions.translateImageLinks(field_0)}
      </property>
      <property name="cssClass">note_content_block</property>
    </properties>
  </widget>

</extension>

<extension target="org.nuxeo.ecm.platform.actions.ActionService"
  point="actions">

  <action id="summary_note_text" type="widget" order="20">
    <category>SUMMARY_TOP_LEFT</category>
    <properties>
      <property name="widgetName">summary_note_text</property>
    </properties>
    <filter-id>hasNote</filter-id>
  </action>

</extension>

This contribution will add the widget named "summary_note_text" to the summary layout when current document is a note (see filter named "hasNote").
The action order will make it possible to change the order of appearance of this new widget in comparison to other "action widgets" defined in the same category.

Content by Label
spaces@self
titleRelated topics
showLabelsfalse
labelssummary-layout
showSpacefalse
typepage