Boxes
Contents
Warning
Starting from CubicWeb version 4.0 all code related to generating html views has been moved to the Cube cubicweb_web.
If you want to migrate a project from 3.38 to 4.* while still using all the
html views you need to both install the cubicweb_web cube AND add it to
your dependencies and run add_cube('web')
.
cubicweb_web can be installed from pypi this way:
pip install cubicweb_web
We donât plan to maintain the features in cubicweb_web in the long run; we are moving to a full javascript frontend using both cubicweb_api (which exposes a HTTP API) and @cubicweb/client as a frontend javascript toolkit.
In the long run cubicweb_api will be merged inside of CubicWeb.
Boxes#
(cubicweb.web.views.boxes
)
- sidebox
This view displays usually a side box of some related entities in a primary view.
The action box#
The add_related
is an automatic menu in the action box that allows to create
an entity automatically related to the initial entity (context in
which the box is displayed). By default, the links generated in this
box are computed from the schema properties of the displayed entity,
but it is possible to explicitly specify them thanks to the
cubicweb.web.views.uicfg.rmode relation tag:
link, indicates that a relation is in general created pointing to an existing entity and that we should not to display a link for this relation
create, indicates that a relation is in general created pointing to new entities and that we should display a link to create a new entity and link to it automatically
If necessary, it is possible to overwrite the method relation_mode(rtype, targettype, x=âsubjectâ) to dynamically compute a relation creation category.
Please note that if at least one action belongs to the addrelated category, the automatic behavior is desactivated in favor of an explicit behavior (e.g. display of addrelated category actions only).