author | sylvain.thenault@logilab.fr |
Tue, 10 Mar 2009 19:35:38 +0100 | |
branch | tls-sprint |
changeset 1036 | 593df4919845 |
parent 306 | 1ed1da008e50 |
permissions | -rw-r--r-- |
74
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
1 |
.. -*- coding: utf-8 -*- |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
2 |
|
280
ce829abf7c29
[doc] Improved tutoriel. Moved appropriate content to cubicweb foundations chapter. Adds section to fill about cubicweb-ctl shell.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
273
diff
changeset
|
3 |
Templates |
ce829abf7c29
[doc] Improved tutoriel. Moved appropriate content to cubicweb foundations chapter. Adds section to fill about cubicweb-ctl shell.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
273
diff
changeset
|
4 |
--------- |
74
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
5 |
|
280
ce829abf7c29
[doc] Improved tutoriel. Moved appropriate content to cubicweb foundations chapter. Adds section to fill about cubicweb-ctl shell.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
273
diff
changeset
|
6 |
Look at ``cubicweb/web/views/basetemplates.py`` and you will |
74
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
7 |
find the base templates used to generate HTML for your application. |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
8 |
|
81
f5886815126b
punctuation stuff
Katia Saurfelt <katia.saurfelt@logilab.fr>
parents:
74
diff
changeset
|
9 |
A page is composed as indicated on the schema below: |
74
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
10 |
|
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
11 |
.. image:: images/lax-book.06-main-template-layout.en.png |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
12 |
|
280
ce829abf7c29
[doc] Improved tutoriel. Moved appropriate content to cubicweb foundations chapter. Adds section to fill about cubicweb-ctl shell.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
273
diff
changeset
|
13 |
In this section we will demonstrate a change in one of the main |
ce829abf7c29
[doc] Improved tutoriel. Moved appropriate content to cubicweb foundations chapter. Adds section to fill about cubicweb-ctl shell.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
273
diff
changeset
|
14 |
interesting template from the three you will look for, |
ce829abf7c29
[doc] Improved tutoriel. Moved appropriate content to cubicweb foundations chapter. Adds section to fill about cubicweb-ctl shell.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
273
diff
changeset
|
15 |
that is to say, the HTMLPageHeader, the HTMLPageFooter |
ce829abf7c29
[doc] Improved tutoriel. Moved appropriate content to cubicweb foundations chapter. Adds section to fill about cubicweb-ctl shell.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
273
diff
changeset
|
16 |
and the TheMainTemplate. |
74
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
17 |
|
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
18 |
|
280
ce829abf7c29
[doc] Improved tutoriel. Moved appropriate content to cubicweb foundations chapter. Adds section to fill about cubicweb-ctl shell.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
273
diff
changeset
|
19 |
Customize a template |
ce829abf7c29
[doc] Improved tutoriel. Moved appropriate content to cubicweb foundations chapter. Adds section to fill about cubicweb-ctl shell.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
273
diff
changeset
|
20 |
~~~~~~~~~~~~~~~~~~~~ |
ce829abf7c29
[doc] Improved tutoriel. Moved appropriate content to cubicweb foundations chapter. Adds section to fill about cubicweb-ctl shell.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
273
diff
changeset
|
21 |
|
ce829abf7c29
[doc] Improved tutoriel. Moved appropriate content to cubicweb foundations chapter. Adds section to fill about cubicweb-ctl shell.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
273
diff
changeset
|
22 |
Based on the diagram below, each template can be overriden |
ce829abf7c29
[doc] Improved tutoriel. Moved appropriate content to cubicweb foundations chapter. Adds section to fill about cubicweb-ctl shell.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
273
diff
changeset
|
23 |
by your customized template. To do so, we recommand you create |
ce829abf7c29
[doc] Improved tutoriel. Moved appropriate content to cubicweb foundations chapter. Adds section to fill about cubicweb-ctl shell.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
273
diff
changeset
|
24 |
a Python module ``blog.views.templates`` to keep it organized. |
ce829abf7c29
[doc] Improved tutoriel. Moved appropriate content to cubicweb foundations chapter. Adds section to fill about cubicweb-ctl shell.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
273
diff
changeset
|
25 |
In this module you will have to import the parent class you are |
ce829abf7c29
[doc] Improved tutoriel. Moved appropriate content to cubicweb foundations chapter. Adds section to fill about cubicweb-ctl shell.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
273
diff
changeset
|
26 |
interested as follows: :: |
ce829abf7c29
[doc] Improved tutoriel. Moved appropriate content to cubicweb foundations chapter. Adds section to fill about cubicweb-ctl shell.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
273
diff
changeset
|
27 |
|
ce829abf7c29
[doc] Improved tutoriel. Moved appropriate content to cubicweb foundations chapter. Adds section to fill about cubicweb-ctl shell.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
273
diff
changeset
|
28 |
from cubicweb.web.views.basetemplates import HTMLPageHeader, \ |
ce829abf7c29
[doc] Improved tutoriel. Moved appropriate content to cubicweb foundations chapter. Adds section to fill about cubicweb-ctl shell.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
273
diff
changeset
|
29 |
HTMLPageFooter, TheMainTemplate |
ce829abf7c29
[doc] Improved tutoriel. Moved appropriate content to cubicweb foundations chapter. Adds section to fill about cubicweb-ctl shell.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
273
diff
changeset
|
30 |
|
ce829abf7c29
[doc] Improved tutoriel. Moved appropriate content to cubicweb foundations chapter. Adds section to fill about cubicweb-ctl shell.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
273
diff
changeset
|
31 |
and then create your sub-class:: |
ce829abf7c29
[doc] Improved tutoriel. Moved appropriate content to cubicweb foundations chapter. Adds section to fill about cubicweb-ctl shell.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
273
diff
changeset
|
32 |
|
ce829abf7c29
[doc] Improved tutoriel. Moved appropriate content to cubicweb foundations chapter. Adds section to fill about cubicweb-ctl shell.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
273
diff
changeset
|
33 |
class MyBlogHTMLPageHeader(HTMLPageHeader): |
ce829abf7c29
[doc] Improved tutoriel. Moved appropriate content to cubicweb foundations chapter. Adds section to fill about cubicweb-ctl shell.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
273
diff
changeset
|
34 |
... |
74
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
35 |
|
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
36 |
Customize header |
116
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
115
diff
changeset
|
37 |
````````````````` |
74
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
38 |
|
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
39 |
Let's now move the search box in the header and remove the login form |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
40 |
from the header. We'll show how to move it to the left column of the application. |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
41 |
|
280
ce829abf7c29
[doc] Improved tutoriel. Moved appropriate content to cubicweb foundations chapter. Adds section to fill about cubicweb-ctl shell.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
273
diff
changeset
|
42 |
Let's say we do not want anymore the login menu to be in the header |
74
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
43 |
|
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
44 |
First, to remove the login menu, we just need to comment out the display of the |
280
ce829abf7c29
[doc] Improved tutoriel. Moved appropriate content to cubicweb foundations chapter. Adds section to fill about cubicweb-ctl shell.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
273
diff
changeset
|
45 |
login graphic component such as follows: :: |
74
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
46 |
|
280
ce829abf7c29
[doc] Improved tutoriel. Moved appropriate content to cubicweb foundations chapter. Adds section to fill about cubicweb-ctl shell.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
273
diff
changeset
|
47 |
class MyBlogHTMLPageHeader(HTMLPageHeader): |
74
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
48 |
|
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
49 |
def main_header(self, view): |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
50 |
"""build the top menu with authentification info and the rql box""" |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
51 |
self.w(u'<table id="header"><tr>\n') |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
52 |
self.w(u'<td id="firstcolumn">') |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
53 |
self.vreg.select_component('logo', self.req, self.rset).dispatch(w=self.w) |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
54 |
self.w(u'</td>\n') |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
55 |
# appliname and breadcrumbs |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
56 |
self.w(u'<td id="headtext">') |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
57 |
comp = self.vreg.select_component('appliname', self.req, self.rset) |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
58 |
if comp and comp.propval('visible'): |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
59 |
comp.dispatch(w=self.w) |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
60 |
comp = self.vreg.select_component('breadcrumbs', self.req, self.rset, view=view) |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
61 |
if comp and comp.propval('visible'): |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
62 |
comp.dispatch(w=self.w, view=view) |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
63 |
self.w(u'</td>') |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
64 |
# logged user and help |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
65 |
#self.w(u'<td>\n') |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
66 |
#comp = self.vreg.select_component('loggeduserlink', self.req, self.rset) |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
67 |
#comp.dispatch(w=self.w) |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
68 |
#self.w(u'</td><td>') |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
69 |
|
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
70 |
self.w(u'<td>') |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
71 |
helpcomp = self.vreg.select_component('help', self.req, self.rset) |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
72 |
if helpcomp: # may not be available if Card is not defined in the schema |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
73 |
helpcomp.dispatch(w=self.w) |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
74 |
self.w(u'</td>') |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
75 |
# lastcolumn |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
76 |
self.w(u'<td id="lastcolumn">') |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
77 |
self.w(u'</td>\n') |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
78 |
self.w(u'</tr></table>\n') |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
79 |
self.template('logform', rset=self.rset, id='popupLoginBox', klass='hidden', |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
80 |
title=False, message=False) |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
81 |
|
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
82 |
|
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
83 |
|
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
84 |
.. image:: images/lax-book.06-header-no-login.en.png |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
85 |
|
280
ce829abf7c29
[doc] Improved tutoriel. Moved appropriate content to cubicweb foundations chapter. Adds section to fill about cubicweb-ctl shell.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
273
diff
changeset
|
86 |
Customize footer |
ce829abf7c29
[doc] Improved tutoriel. Moved appropriate content to cubicweb foundations chapter. Adds section to fill about cubicweb-ctl shell.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
273
diff
changeset
|
87 |
```````````````` |
74
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
88 |
|
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
89 |
If you want to change the footer for example, look |
293
a21688a55d21
[doc] Move out from tutoriel RSS and CSS to make it independant chapters. Adds a conclusion to the tutorial.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
280
diff
changeset
|
90 |
for HTMLPageFooter and override it in your views file as in: :: |
74
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
91 |
|
293
a21688a55d21
[doc] Move out from tutoriel RSS and CSS to make it independant chapters. Adds a conclusion to the tutorial.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
280
diff
changeset
|
92 |
from cubicweb.web.views.basetemplates import HTMLPageFooter |
a21688a55d21
[doc] Move out from tutoriel RSS and CSS to make it independant chapters. Adds a conclusion to the tutorial.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
280
diff
changeset
|
93 |
|
74
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
94 |
class MyHTMLPageFooter(HTMLPageFooter): |
293
a21688a55d21
[doc] Move out from tutoriel RSS and CSS to make it independant chapters. Adds a conclusion to the tutorial.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
280
diff
changeset
|
95 |
|
74
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
96 |
def call(self, **kwargs): |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
97 |
self.w(u'<div class="footer">') |
306
1ed1da008e50
[doc] Removes references to LAX.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
293
diff
changeset
|
98 |
self.w(u'This website has been created with <a href="http://cubicweb.org">CubicWeb</a>.') |
74
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
99 |
self.w(u'</div>') |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
100 |
|
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
101 |
Updating a view does not require any restart of the server. By reloading |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
102 |
the page you can see your new page footer. |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
103 |
|
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
104 |
|
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
105 |
TheMainTemplate |
280
ce829abf7c29
[doc] Improved tutoriel. Moved appropriate content to cubicweb foundations chapter. Adds section to fill about cubicweb-ctl shell.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
273
diff
changeset
|
106 |
``````````````` |
116
e2303f9b5bfa
[doc] more merging and reorg
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
115
diff
changeset
|
107 |
|
74
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
108 |
.. _TheMainTemplate: |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
109 |
|
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
110 |
The MainTemplate is a bit complex as it tries to accomodate many |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
111 |
different cases. We are now about to go through it and cutomize entirely |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
112 |
our application. |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
113 |
|
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
114 |
TheMainTemplate is responsible for the general layout of the entire application. |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
115 |
It defines the template of ``id = main`` that is used by the application. Is |
280
ce829abf7c29
[doc] Improved tutoriel. Moved appropriate content to cubicweb foundations chapter. Adds section to fill about cubicweb-ctl shell.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
273
diff
changeset
|
116 |
also defined in ``cubicweb/web/views/basetemplates.py`` another template that can |
74
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
117 |
be used based on TheMainTemplate called SimpleMainTemplate which does not have |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
118 |
a top section. |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
119 |
|
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
120 |
.. image:: images/lax-book.06-simple-main-template.en.png |
9a9fe515934d
[doc] reuse the lax book
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff
changeset
|
121 |
|
280
ce829abf7c29
[doc] Improved tutoriel. Moved appropriate content to cubicweb foundations chapter. Adds section to fill about cubicweb-ctl shell.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
273
diff
changeset
|
122 |
XXX |
ce829abf7c29
[doc] Improved tutoriel. Moved appropriate content to cubicweb foundations chapter. Adds section to fill about cubicweb-ctl shell.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
273
diff
changeset
|
123 |
[WRITE ME] |
ce829abf7c29
[doc] Improved tutoriel. Moved appropriate content to cubicweb foundations chapter. Adds section to fill about cubicweb-ctl shell.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
273
diff
changeset
|
124 |
|
ce829abf7c29
[doc] Improved tutoriel. Moved appropriate content to cubicweb foundations chapter. Adds section to fill about cubicweb-ctl shell.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
273
diff
changeset
|
125 |
* customize MainTemplate and show that everything in the user |
ce829abf7c29
[doc] Improved tutoriel. Moved appropriate content to cubicweb foundations chapter. Adds section to fill about cubicweb-ctl shell.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
273
diff
changeset
|
126 |
interface can be changed |
ce829abf7c29
[doc] Improved tutoriel. Moved appropriate content to cubicweb foundations chapter. Adds section to fill about cubicweb-ctl shell.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents:
273
diff
changeset
|
127 |