How can I get document label and use it in result of content view
Hello
I create a document type “bilan_carbone” with label “Bilan Carbone”.
Then I create a content view, and in results I have a column with document type (Document). But this column display the ID of the document type instead of label.
How can I display label of this document type ?
I configure this document type in Studio. Here the capture of configuration :
Then the configuration of my content view where show document type ID instead of document type label . I use the widget system:document type:
Thanks in advance.
There is not default widget type displaying the label of a given document type (except the one also displaying an icon), and the system widget you're using will just display the id of the document type.
The easiest would be to define an advanced widget template with the following content:
<div xmlns:nxd="http://nuxeo.org/nxweb/document"
xmlns:h="http://java.sun.com/jsf/html">
<h:outputText value="#{messages[nxd:typeLabel(field)]}" />
</div>
In the widget definition, you'll have to map a “field” to item “data” as in result layouts, each bound item is a wrapper object of the document.
Hello, I search to do the same action. I have created a widget and I search to have the labl of the document type, but nothing happend. my widget :
but when I use the widget in creation view, I don't know how to configure the widget, can you help me ? thanks
I think you have to check the translate field into the definition of your widget that displays this item and add the translation key/value into your messages_fr.properties file that you can download from Resources in Studio.
Hopes this help.
I'll have a look.