cancel
Showing results for 
Search instead for 
Did you mean: 

How can I get document label and use it in result of content view

delphine_
Star Contributor
Star Contributor

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 ?

alt text

I configure this document type in Studio. Here the capture of configuration :
/> alt text Then the configuration of my content view where show document type ID instead of document type label . I use the widget system:document type:
/> alt text
/>

Thanks in advance.

10 REPLIES 10

Benjamin_Jalon1
Elite Collaborator
Elite Collaborator

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.

Thanks for your answer. But it's not an item but the label of document type. In the picture it's display the ID of this document type. Perhaps another idea ?

Anahide_Tchertc
Elite Collaborator
Elite Collaborator

Can you describe where you put the label "Bilan Carbone"? Is it in the document type configuration in Studio?

Anahide_Tchertc
Elite Collaborator
Elite Collaborator

Thanks for the extra info (please leave a comment when you modify your post so that we get notified).

Anahide_Tchertc
Elite Collaborator
Elite Collaborator

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.

Ok, but if I want to filter the documents in the "result layouts" by document label, How would I do it?

You'll need to define a custom widget template too to generate the list of selections, retrieving the label for each of the types you'd like to display (similarly to what you explained on your answer).

Thanks for your help. I will test that quickly !

vjoussot_
Star Contributor
Star Contributor

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 : <f:subview xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" xmlns:nxu="http://nuxeo.org/nxweb/util" xmlns:nxdir="http://nuxeo.org/nxdirectory" xmlns:c="http://java.sun.com/jstl/core" xmlns:nxp="http://nuxeo.org/nxweb/pdf" id="#{widget.id}">

but when I use the widget in creation view, I don't know how to configure the widget, can you help me ? thanks

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.