1 .. -*- coding: utf-8 -*- |
1 .. -*- coding: utf-8 -*- |
2 |
2 |
3 Base views (:mod:`cubicweb.web.views.baseviews`) |
3 Base views |
4 ------------------------------------------------ |
4 ---------- |
5 |
5 |
6 *CubicWeb* provides a lot of standard views. You can find them in |
6 *CubicWeb* provides a lot of standard views, that can be found in |
7 ``cubicweb/web/views/``. |
7 :mod:`cubicweb.web.views` and :mod:`cubicweb.web.views.baseviews`. |
8 |
8 |
9 A certain number of views are used to build the web interface, which apply |
9 A certain number of views are used to build the web interface, which |
10 to one or more entities. Their identifier is what distinguish them from |
10 apply to one or more entities. Their identifier is what distinguish |
11 each others and the main ones are: |
11 them from each others and the main ones are: |
12 |
12 |
13 HTML views |
13 HTML views |
14 ~~~~~~~~~~ |
14 ~~~~~~~~~~ |
15 |
15 |
16 Special views |
16 Special views |
22 |
22 |
23 *final* |
23 *final* |
24 Display the value of a cell without trasnformation (in case of a non 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. |
25 entity, we see the eid). Applicable on any result set. |
26 |
26 |
|
27 .. note:: |
|
28 |
|
29 `final` entities are merely attributes. |
|
30 |
27 *null* |
31 *null* |
28 This view is the default view used when nothing needs to be rendered. |
32 This view is the default view used when nothing needs to be rendered. |
29 It is always applicable and it does not return anything |
33 It is always applicable. |
30 |
34 |
31 Entity views |
35 Entity views |
32 ```````````` |
36 ```````````` |
|
37 |
33 *incontext, outofcontext* |
38 *incontext, outofcontext* |
34 Those are used to display a link to an entity, depending on the |
39 Those are used to display a link to an entity, depending on the |
35 entity having to be displayed in or out of context |
40 entity having to be displayed in or out of context |
36 (of another entity). By default it respectively returns the |
41 (of another entity). By default it respectively produces the |
37 result of `textincontext` and `textoutofcontext` wrapped in a link |
42 result of `textincontext` and `textoutofcontext` wrapped in a link |
38 leading to the primary view of the entity. |
43 leading to the primary view of the entity. |
39 |
44 |
40 *oneline* |
45 *oneline* |
41 This view is used when we can't tell if the entity should be considered as |
46 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` |
47 displayed in or out of context. By default it produces the result of `text` |
43 in a link leading to the primary view of the entity. |
48 in a link leading to the primary view of the entity. |
44 |
49 |
45 List |
50 List |
46 ````` |
51 ````` |
47 |
52 |
65 coma separated list. It is NOT related to the well-known text file |
70 coma separated list. It is NOT related to the well-known text file |
66 format. |
71 format. |
67 |
72 |
68 Text entity views |
73 Text entity views |
69 ~~~~~~~~~~~~~~~~~ |
74 ~~~~~~~~~~~~~~~~~ |
|
75 |
70 *text* |
76 *text* |
71 This is the simplest text view for an entity. By default it returns the |
77 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 |
78 result of the `.dc_title` method, which is cut to fit the |
73 `navigation.short-line-size` property if necessary. |
79 `navigation.short-line-size` property if necessary. |
74 |
80 |