TheCubicWebBook #342778 Rewrite View chapter [resolved]

This chapter needs to be re-organized in order to prove that writing a view is easy. Start with a description of the interface might not be a good choice.

I believe it would be better to start with an example of a primary view, explain the different methods render_* and how to properly customize it.

Dixit email exchange:

> + def render_entity(self, entity):

Not better than overwrite cell_call.

In general it is better to overwrite one or mode of the following methods :

  • render_entity_title
  • render_entity_metadata
  • render_entity_attributes
  • render_entity_relations

In the case the use of the class attributes is not enough to answer our needs:

  • show_attr_label
  • show_rel_label
  • skip_none
  • skip_attrs
  • skip_rels
done incw_course
load left0.000
closed by<not specified>