doc/book/devweb/views/boxes.rst
changeset 10491 c67bcee93248
parent 8665 e65af61bde7d
equal deleted inserted replaced
10490:76ab3c71aff2 10491:c67bcee93248
       
     1 Boxes
       
     2 -----
       
     3 
       
     4 (:mod:`cubicweb.web.views.boxes`)
       
     5 
       
     6 *sidebox*
       
     7   This view displays usually a side box of some related entities
       
     8   in a primary view.
       
     9 
       
    10 The action box
       
    11 ~~~~~~~~~~~~~~~
       
    12 
       
    13 The ``add_related`` is an automatic menu in the action box that allows to create
       
    14 an entity automatically related to the initial entity (context in
       
    15 which the box is displayed). By default, the links generated in this
       
    16 box are computed from the schema properties of the displayed entity,
       
    17 but it is possible to explicitly specify them thanks to the
       
    18 `cubicweb.web.views.uicfg.rmode` *relation tag*:
       
    19 
       
    20 * `link`, indicates that a relation is in general created pointing
       
    21   to an existing entity and that we should not to display a link
       
    22   for this relation
       
    23 
       
    24 * `create`, indicates that a relation is in general created pointing
       
    25   to new entities and that we should display a link to create a new
       
    26   entity and link to it automatically
       
    27 
       
    28 
       
    29 If necessary, it is possible to overwrite the method
       
    30 `relation_mode(rtype, targettype, x='subject')` to dynamically
       
    31 compute a relation creation category.
       
    32 
       
    33 Please note that if at least one action belongs to the `addrelated` category,
       
    34 the automatic behavior is desactivated in favor of an explicit behavior
       
    35 (e.g. display of `addrelated` category actions only).
       
    36