Colored field on summary-view(detail)

Hello guys, 

I'd like to make a customization in summary-view, a part of detail view. This customization is on a field that depending of his value the background color and the text color should be changed. Ex.:

Field is field_test_c, when his value is abcd, the background color of the field should be green and the text color white.

Follow a print with the example, maked  using developer mode of the browser.

Is it possible? If yes, could you give me a north with the correct extension and the overrided function that can capture the model object with the fields values populateded?

Thanks!

Parents
  • Hi Felipe
    yes, your customization should be fairly trivial to implement

    Override field's onBeforeRender function. At the moment of execution you will have access to current field value so you will be able to apply appropriate css class

Reply
  • Hi Felipe
    yes, your customization should be fairly trivial to implement

    Override field's onBeforeRender function. At the moment of execution you will have access to current field value so you will be able to apply appropriate css class

Children
No Data