Page template dossier
Bonjour
j'utilise une page template sur un dossier :
http://www.dison.eu/economie/acteurs-socio-economiques/a-d-l/
nom de la template : accueil-assoc
le but étant d'afficher pour cette association ses actualités et son agenda via pour chacun un dossier automatique. Pour les actus pas de soucis mais pourl'agenda je n'arrive pas a avoir le lien vers l'evenement sur le titre ... j'ai regardé comment était faite la page d'accueil du site et en fait le code ci-dessous fonctionne, j'ai donc tout sauf le lien :
<tal:loop repeat="brain brains">
<tr><td>
<p>
<br /><span class="link-event" tal:content="python: brain.getObject().Title()" />
<br /><b><span tal:content="python: brain.getObject().Description()" /></b>
<br />
<span class="documentByLine">
<!-- on personnalise si l'event dure un jour ou plusieurs... -->
<tal
ne_day condition="python: here.toLocalizedTime(brain.getObject().start(), long_format=0) == here.toLocalizedTime(brain.getObject().end(), long_format=0)">
le <span tal:content="python: here.toLocalizedTime(brain.getObject().start(), long_format=0)" /> de <span tal:content="python: here.toLocalizedTime(brain.getObject().start(), long_format=1)[11:]" /> à <span tal:content="python: here.toLocalizedTime(brain.getObject().end(), long_format=1)[11:]" />
</tal
ne_day>
<tal:more_days condition="python: here.toLocalizedTime(brain.getObject().start(), long_format=0) != here.toLocalizedTime(brain.getObject().end(), long_format=0)">
du <span tal:content="python: here.toLocalizedTime(brain.getObject().start(), long_format=1)" /> au
<span tal:content="python: here.toLocalizedTime(brain.getObject().end(), long_format=1)" />
</tal:more_days>
</span>
</p>
</td></tr>
</tal:loop> Mais si j'ajoute le lien (en gras ci-dessous), au moment de sauver la template j'ai une page blanche et ca ne fonctionne donc pas .... qu'aurai-je loupé ????? :
...
<tal:loop repeat="brain brains">
<tr><td>
<p>
<a href="#" tal:attributes="href python: brain.getObject().absolute_url()"> <br /><span class="link-event" tal:content="python: brain.getObject().Title()" />
</a>
<br /><b><span tal:content="python: brain.getObject().Description()" /></b>
<br />
<span class="documentByLine">
<!-- on personnalise si l'event dure un jour ou plusieurs... -->
<talne_day condition="python: here.toLocalizedTime(brain.getObject().start(), long_format=0) == here.toLocalizedTime(brain.getObject().end(), long_format=0)">
le <span tal:content="python: here.toLocalizedTime(brain.getObject().start(), long_format=0)" /> de <span tal:content="python: here.toLocalizedTime(brain.getObject().start(), long_format=1)[11:]" /> à <span tal:content="python: here.toLocalizedTime(brain.getObject().end(), long_format=1)[11:]" />
</talne_day>
<tal:more_days condition="python: here.toLocalizedTime(brain.getObject().start(), long_format=0) != here.toLocalizedTime(brain.getObject().end(), long_format=0)">
du <span tal:content="python: here.toLocalizedTime(brain.getObject().start(), long_format=1)" /> au
<span tal:content="python: here.toLocalizedTime(brain.getObject().end(), long_format=1)" />
</tal:more_days>
</span>
</p>
</td></tr>
</tal:loop>
Philippe
Voilà le code que j'ai mis :
<a href="#" tal:attributes="href obj/absolute_url"><span class="link-event" tal:content="obj/Title" /></a>
En outre, j'ai initialisé une première fois obj a brain.getObject() sinon, faire des getObject +ieurs fois prend des ressources pour rien 
Bon travail,
Gauthier Bastien, AC Sambreville

