1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
| <tal:globals define="global IsHomePage python:context == container;
global rubrics python:container.objectValues(['Folder','Folder (Ordered)'])" />
<html>
<head>
<title tal:content="template/title">The title</title>
</head>
<body>
<!-- initialisation de variables globales -->
<center>
<h1 tal:content="container/title_or_id"> Titre de la page </h1>
</center>
Menu de navigation
<ul>
<h3 tal:content="python:len(rubrics)" />
<li>
<a href=""
tal:omit-tag="IsHomePage"
tal:attributes="href container/absolute_url">Accueil</a>
</li>
<li tal:repeat="rubric rubrics">
<a href=""
tal:omit-tag="python:context == rubric"
tal:attributes="href rubric/absolute_url;
title rubric/title_or_id">
<span tal:content="rubric/title_or_id" />
</a>
</li>
</ul>
<center>
<tal:home tal:condition="IsHomePage">
<h2 tal:content="context/title_or_id" />
<p> Bienvenue sur <em tal:content="container/title_or_id" />
<br><br>
<textarea tal:content="context/description | nothing"></textarea>
</tal:home>
<tal:nothome tal:condition="not: IsHomePage">
<h2 tal:content="context/title_or_id" />
<br><br>
<textarea tal:content="python: context.getProperty('description', 'no description')"></textarea>
<div tal:define="items context/objectValues">
<tal:item tal:repeat="item items">
<div tal:attributes="style python:test(repeat['item'].even(),'background:#cccccc','background:#ffffff')" />
<!-- on affiche le titre -->
<h2 tal:content="item/title_or_id" />
<div tal:condition="not:python:item.meta_type == 'File'">
<!-- permet de visualiser le contenu des image ou des DTML -->
<div tal:replace="structure item" />
</div>
<div tal:condition="python:item.meta_type == 'File'">
<!-- permet d'afficher un lien vers le fichier -->
<a href=""
tal:attributes="href item/absolute_url;
title item/title_or_id">
<span tal:content="item/title_or_id" />
</a>
</div>
</tal:item>
</div>
</tal:nothome>
</body>
</html> |
Partager