Chamilo
Search…
Structure of a page
The structure of a typical page will thus be something close to the following. We are using a shortened version of main/template/default/layout/layout_2_col.tpl here, for the sake of documentation. layout_2_col means « layout for 2 colums page », and it is selected when we want to show things like the courses list, because on this screen we have two columns: the side menu and the list of courses.
All normal HTML tag will appear as is. No need for any trick.
1
{% extends template ~ "/layout/main.tpl" %}
2
{% block body %}
3
{# Main content #}
4
{# Right column #}
5
<div class="span3 menu-column">
6
{# if user is not login show the login form #}
7
{% if _u.logged == 0 %}
8
{% include template ~ "/layout/login_form.tpl" %}
9
{% endif %}
10
{# User picture #}
11
{{ user_image_block }}
12
{{# User Profile links #}
13
{{ profile_block }}
14
</div>
15
<div class="span9 content-column">
16
{# Portal homepage #}
17
{% if home_page_block %}
18
<section id="homepage">
19
<div class="row">
20
<div class="span9">
21
{{ home_page_block }}
22
</div>
23
</div>
24
</section>
25
{% endif %}
26
{% include template ~ "/layout/page_body.tpl" %}
27
{% if content is not null %}
28
<section id="main_content">
29
{{ content }}
30
</section>
31
{% endif %}
32
</div>
33
{% endblock %}
Copied!
As you can see in the example, some « include » statements can be found. They get the indicated file and put its content right where you placed the call. This is practical to re-use other already-templated blocks.
Last modified 1yr ago
Export as PDF
Copy link