Vous êtes ici : Accueil Support Forums Zope/Plone utilisation Page template dossier

Page template dossier

Remonter à Zope/Plone utilisation

Page template dossier

Envoyé par Philippe Stitou (AC Dison) le 1 Juin 2010 à 15:54

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:one_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:one_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... -->
          <tal:one_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:one_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

Re: Page template dossier

Envoyé par Gauthier Bastien (CommunesPlone) le 1 Juin 2010 à 16:2

Je vais jeter un oeil à la template ;)

Bien à toi,

Gauthier Bastien, AC Sambreville

 

Re: Page template dossier

Envoyé par Gauthier Bastien (CommunesPlone) le 1 Juin 2010 à 16:6

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

Re: Page template dossier

Envoyé par Philippe Stitou (AC Dison) le 2 Juin 2010 à 14:7

Merci

Rendu par Ploneboard
Actions sur le document