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 ?

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.

0 votes

3 answers

2859 views

ANSWER

Can you describe where you put the label "Bilan Carbone"? Is it in the document type configuration in Studio? The result layout looks like it's customized. What kind of widget are you using on this column configuration?
11/22/2012

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

I'll have a look.

11/29/2012



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.

1 votes



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

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).
11/30/2012

Thanks for your help. I will test that quickly !
12/06/2012


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

0 votes



should to do a new question
06/17/2013


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.

0 votes



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 ?
11/22/2012