# HG changeset patch # User Sylvain Thénault # Date 1285157004 -7200 # Node ID 1aad5389c013b1c75da3304eb60e914d437dfd1d # Parent ca5d09ff0379845ca40925eed5039c9a374dc3db [book] backport documentation about primary/base views sent on the list diff -r ca5d09ff0379 -r 1aad5389c013 doc/book/en/devweb/views/baseviews.rst --- a/doc/book/en/devweb/views/baseviews.rst Wed Sep 22 13:33:17 2010 +0200 +++ b/doc/book/en/devweb/views/baseviews.rst Wed Sep 22 14:03:24 2010 +0200 @@ -4,11 +4,12 @@ ---------- *CubicWeb* provides a lot of standard views, that can be found in - :mod:`cubicweb.web.views` and :mod:`cubicweb.web.views.baseviews`. +:mod:`cubicweb.web.views` sub-modules. -A certain number of views are used to build the web interface, which -apply to one or more entities. Their identifier is what distinguish -them from each others and the main ones are: +A certain number of views are used to build the web interface, which apply to one +or more entities. As other appobject, Their identifier is what distinguish them +from each others. The most generic ones, found in +:mod:`cubicweb.web.views.baseviews`, are described below. HTML views ~~~~~~~~~~ @@ -32,53 +33,105 @@ This view is the default view used when nothing needs to be rendered. It is always applicable. + Entity views ```````````` *incontext, outofcontext* - Those are used to display a link to an entity, depending on the - entity having to be displayed in or out of context - (of another entity). By default it respectively produces the - result of `textincontext` and `textoutofcontext` wrapped in a link - leading to the primary view of the entity. + + Those are used to display a link to an entity, whose label depends on the + entity having to be displayed in or out of context (of another entity): some + entities make sense in the context of another entity. For instance, the + `Version` of a `Project` in forge. So one may expect that 'incontext' will + be called when display a version from within the context of a project, while + 'outofcontext"' will be called in other cases. In our example, the + 'incontext' view of the version would be something like '0.1.2', while the + 'outofcontext' view would include the project name, e.g. 'baz 0.1.2' (since + only a version number without the associated project doesn't make sense if + you don't know yet that you're talking about the famous 'baz' project. |cubicweb| + tries to make guess and call 'incontext'/'outofcontext' nicely. When it can't + know, the 'oneline' view should be used. + + By default it respectively produces the result of `textincontext` and + `textoutofcontext` wrapped in a link leading to the primary view of the + entity. + *oneline* + This view is used when we can't tell if the entity should be considered as - displayed in or out of context. By default it produces the result of `text` + displayed in or out of context. By default it produces the result of `text` in a link leading to the primary view of the entity. + List ````` *list* - This view displays a list of entities by creating a HTML list (`