It's in the espaces client that the contributor will be able to add conten rows In the properties of a template, an admin can then choose the default rows to embed. You can also define rows groups to limit their use on some templates or to some users. During the template creation, you just have to define the areas that will display the content rows.
It's very simple, just add an <atm-clientspace /> element. This tag has two mandatory attributes : module et id. The first one will tell to wich module the area is relatedand the second one will identify each clientspace. These are important, clientspaces ID are then used for the templates compatibility.
Automne main module is the pages modules, also called standard module. For instance, to declare an editable area for the main content, we write :
1.
<
atm-clientspace
module
=
"standard"
id
=
"main-content"
/>
We recommend to choose semantic ID in order to know what kinf of information is in the container. This will be very useful for the templates compatibility.
In our template, there are two different content areas : an area for the main content and another for the aside content, so I will add another clientspace :
1.
<
atm-clientspace
module
=
"standard"
id
=
"aside"
/>
Now we insert both clientspaces in our template :
01.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
02.
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
lang
=
"en"
xml:lang
=
"en"
>
03.
<
head
>
04.
<
title
><
atm-title
/> - <
atm-constant
name
=
"APPLICATION_LABEL"
/></
title
>
05.
<
meta
http-equiv
=
"Content-Type"
content
=
"text/html;charset=UTF-8"
/>
06.
<
atm-meta-tags
/>
07.
<
atm-css-tags
files
=
"/css/reset.css,/css/base.css,/css/fonts.css"
media
=
"all"
/>
08.
<!--[if IE 7]>
09.
<
link
rel
=
"stylesheet"
href
=
"/css/ie7.css"
type
=
"text/css"
media
=
"all"
/>
10.
<![endif]-->
11.
<
atm-css-tags
files
=
"/css/print.css"
media
=
"print"
/>
12.
<
atm-css-tags
files
=
"/css/mobile.css"
media
=
"handeld"
/>
13.
<
atm-js-tags
files
=
"/js/jquery-1.4.2.js,/js/myscript.js"
/>
14.
</
head
>
15.
<
body
>
16.
<
div
id
=
"header"
>
17.
<
atm-linx
type
=
"recursivelinks"
>
18.
<
selection
>
19.
<!-- Start from root website -->
20.
<
start
>
21.
<
nodespec
type
=
"relative"
value
=
"root"
></
nodespec
>
22.
</
start
>
23.
<!-- Display the first two levels -->
24.
<
condition
property
=
"lvl"
operator
=
"<="
>
25.
<
value
type
=
"data"
>2</
value
>
26.
</
condition
>
27.
</
selection
>
28.
<!-- Menu closed by default and hide root page -->
29.
<
display
mode
=
"close"
root
=
"0"
><
htmltemplate
>
30.
<!-- HTML template with variables -->
31.
<
li
><
a
href
=
"{{href}}"
>{{title}}</
a
></
li
></
htmltemplate
>{{sublevel}}
32.
<!-- Recursivity template -->
33.
<
subleveltemplate
><
ul
>{{sublevel}}</
ul
></
subleveltemplate
></
display
>
34.
</
atm-linx
>
35.
</
div
>
36.
<
div
id
=
"main-content"
>
37.
<
div
id
=
"breadcrumbs"
>You are here :
38.
<!-- Descendant link type -->
39.
<
atm-linx
type
=
"desclinks"
>
40.
<
selection
>
41.
<!-- Start from root page -->
42.
<
start
>
43.
<
nodespec
type
=
"relative"
value
=
"root"
/>
44.
</
start
>
45.
<!-- Stop at the current page -->
46.
<
stop
>
47.
<
nodespec
type
=
"relative"
value
=
"self"
/>
48.
</
stop
>
49.
</
selection
>
50.
<
display
>
51.
<!-- Display links -->
52.
<
htmltemplate
>
53.
<
a
href
=
"{{href}}"
>{{title}}</
a
>
54.
</
htmltemplate
>
55.
</
display
>
56.
</
atm-linx
>
57.
</
div
>
58.
<
atm-clientspace
module
=
"standard"
id
=
"main-content"
/>
59.
</
div
>
60.
<
div
class
=
"aside"
>
61.
<
atm-clientspace
module
=
"standard"
id
=
"aside"
/>
62.
</
div
>
63.
<
div
id
=
"footer"
>
64.
<
atm-linx
type
=
"sublinks"
>
65.
<
selection
>
66.
<!-- Select the page with an ID of 10 -->
67.
<
start
>
68.
<
nodespec
type
=
"node"
value
=
"10"
/>
69.
</
start
>
70.
</
selection
>
71.
<
display
>
72.
<!-- Display an HTML unordered list -->
73.
<
htmltemplate
>
74.
<
li
>
75.
<
a
href
=
"{{href}}"
>{{title}}</
a
>
76.
</
li
>
77.
</
htmltemplate
>
78.
<
subleveltemplate
>
79.
<
ul
class
=
"links"
>{{sublevel}}</
ul
>
80.
</
subleveltemplate
>
81.
</
display
>
82.
</
atm-linx
>
83.
</
div
>
84.
<
address
>
85.
<!-- Display last modification time and editor -->
86.
<
atm-last-update
format
=
"d/m/Y H:i:s"
><
small
>Dernière mise à jour : {{date}} par {{firstname}} {{lastname}}</
small
></
atm-last-update
>
87.
</
address
>
88.
</
body
>
89.
</
html
>
You have other XML tags like <atm-last-update> inserted here in the footer that will offer you other possibilites in the templates.
Nous now have a generic template page. The next step is to write your own content rows or adapt the existing ones to customize your website pages.
I hope this tutorial helped you understand how to develop you own Automne templates.
If you need help, go and ask your questions on the forums.
Add a contribution