cancel
Showing results for 
Search instead for 
Did you mean: 

Is possible to change the color of a content view list based on a value of a metadata?

apagulayan_
Champ on-the-rise
Champ on-the-rise

For example, I would like to have a different colour for all rows having the same version number or contributor in the list. How could I customise the style (css) of the content view list?

1 ACCEPTED ANSWER

Anahide_Tchertc
Elite Collaborator
Elite Collaborator

Hi,

Style class on table/tr element is hardcoded right now (and only handles dataRowEven/dataRowOdd classes), so that is not easily configurable.

You can look into the layout template used for the listing rendering to see how all this is done here: https://github.com/nuxeo/nuxeo-jsf/blob/master/nuxeo-platform-webapp-base/src/main/resources/web/nux...

If you'd like to retrieve the current item here, it'll probably be available by expression "#{value.data} since each item is a PageSelection here.

There are other kinds of customizations available, but not directly on the tr element. For instance you can control the style class of a widget within each td, and you can also set a style class on each column (this is doable in Studio, but obviously in this case you need a static class, it cannot depend on the document)

View answer in original post

3 REPLIES 3

Lise_Kemen
Star Contributor
Star Contributor

Hello,

apagulayan_
Champ on-the-rise
Champ on-the-rise

Is it possible to add a css class on the table/tr element?

Anahide_Tchertc
Elite Collaborator
Elite Collaborator

Hi,

Style class on table/tr element is hardcoded right now (and only handles dataRowEven/dataRowOdd classes), so that is not easily configurable.

You can look into the layout template used for the listing rendering to see how all this is done here: https://github.com/nuxeo/nuxeo-jsf/blob/master/nuxeo-platform-webapp-base/src/main/resources/web/nux...

If you'd like to retrieve the current item here, it'll probably be available by expression "#{value.data} since each item is a PageSelection here.

There are other kinds of customizations available, but not directly on the tr element. For instance you can control the style class of a widget within each td, and you can also set a style class on each column (this is doable in Studio, but obviously in this case you need a static class, it cannot depend on the document)