Adding Content on Summary View for Facet


I'm trying to figure out the best way to add content in the summary view if a facet is present for the document.

Already have an xhtml file with the content, but can't figure out how to declare it for it to show in the view.

Any pointer would be appreciated.


0 votes

2 answers



There are several ways to do that depending on how you'd like this feature to affect all document types, or whether you'd like to fine-tune it per document type.

To affect all document types, the easiest is to override the /incl/tabs/document_view.xhtml template to add your specific xhtml code.

To affect only some document types, you can package the xhtml code as a widget template, taking example on what's done for the widget showing comments in the summary, for instance: this template is at /widgets/summary/comments_widget_template.xhtml and its definition is made through extension points, you can browse it content here: org.nuxeo.ecm.platform.forms.layouts.webapp.summary

Note that the summary layout can be configured on documents by specifying the layout to use in the mode “summary”, see for instance the specific configuration for the “Note” document type:

<type id="Note">
  <layouts mode="summary">

Defining your code as a widget template is also a good thing to be able to configure its presence on the summary view of a given document type using Nuxeo Studio.

3 votes

The problem with overriding, it makes you more fragile to updates in nuxeo-dm.

Can you use the mode="summary" thing on facet? As in (where NewFacet is a Facet)? :

&lt;type id=&quot;NewFacet&quot;&gt;
  &lt;layouts mode=&quot;summary&quot;&gt;

You're right, the second option is better in terms of maintenance.

The thing is that UI information is attached to the UI document type definition (vs. the "core" definition that defines what facets are present on the document). And until recently, facets could not hold schemas definition, and could not be added dynamically on a document instance.

Now having a system to gracefully retrieve additional layouts from facets would make sense, but still, we'd like it to be configurable per document type. Overriding the layout definitions attached to a document type is easy enough for now.


If you already have the content and the XHTML, what you have to do is to declare an action in a contrib to display your content. Something like this:

<?xml version="1.0" encoding="UTF-8"?>
<component name="">

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


<action id="my_view" link="/incl/tabs/my_document_view.xhtml"
        enabled="true" label="My view" icon="/icons/file.gif" order="9">
  <filter id="my_document_view_filter">
    <rule grant="true">



This will display your content as a new tab.

If the only thing you want is to display your content on summary, go to summary xhtml and include your own.

0 votes