1 .. -*- coding: utf-8 -*- |
|
2 |
|
3 Base views (:mod:`cubicweb.web.views.baseviews`) |
|
4 ------------------------------------------------ |
|
5 |
|
6 *CubicWeb* provides a lot of standard views. You can find them in |
|
7 ``cubicweb/web/views/``. |
|
8 |
|
9 A certain number of views are used to build the web interface, which apply |
|
10 to one or more entities. Their identifier is what distinguish them from |
|
11 each others and the main ones are: |
|
12 |
|
13 HTML views |
|
14 ~~~~~~~~~~ |
|
15 |
|
16 Special views |
|
17 ````````````` |
|
18 |
|
19 *noresult* |
|
20 This view is the default view used when no result has been found |
|
21 (e.g. empty result set). |
|
22 |
|
23 *final* |
|
24 Display the value of a cell without trasnformation (in case of a non final |
|
25 entity, we see the eid). Applicable on any result set. |
|
26 |
|
27 *null* |
|
28 This view is the default view used when nothing needs to be rendered. |
|
29 It is always applicable and it does not return anything |
|
30 |
|
31 Entity views |
|
32 ```````````` |
|
33 *incontext, outofcontext* |
|
34 Those are used to display a link to an entity, depending on the |
|
35 entity having to be displayed in or out of context |
|
36 (of another entity). By default it respectively returns the |
|
37 result of `textincontext` and `textoutofcontext` wrapped in a link |
|
38 leading to the primary view of the entity. |
|
39 |
|
40 *oneline* |
|
41 This view is used when we can't tell if the entity should be considered as |
|
42 displayed in or out of context. By default it returns the result of `text` |
|
43 in a link leading to the primary view of the entity. |
|
44 |
|
45 List |
|
46 ````` |
|
47 |
|
48 *list* |
|
49 This view displays a list of entities by creating a HTML list (`<ul>`) |
|
50 and call the view `listitem` for each entity of the result set. |
|
51 |
|
52 *listitem* |
|
53 This view redirects by default to the `outofcontext` view. |
|
54 |
|
55 *sameetypelist* |
|
56 This view displays a list of entities of the same type, in HTML section (`<div>`) |
|
57 and call the view `sameetypelistitem` for each entity of the result set. |
|
58 |
|
59 *sameetypelistitem* |
|
60 This view redirects by default to the `listitem` view. |
|
61 |
|
62 *csv* |
|
63 This view applies to entity groups, which are individually |
|
64 displayed using the `incontext` view. It displays each entity as a |
|
65 coma separated list. It is NOT related to the well-known text file |
|
66 format. |
|
67 |
|
68 Text entity views |
|
69 ~~~~~~~~~~~~~~~~~ |
|
70 *text* |
|
71 This is the simplest text view for an entity. By default it returns the |
|
72 result of the `.dc_title` method, which is cut to fit the |
|
73 `navigation.short-line-size` property if necessary. |
|
74 |
|
75 *textincontext, textoutofcontext* |
|
76 Similar to the `text` view, but called when an entity is considered out or |
|
77 in context. By default it returns respectively the result of the |
|
78 methods `.dc_title` and `.dc_long_title` of the entity. |
|