1 / 8

Le mécanisme de templates de Sympa

Le mécanisme de templates de Sympa. Objectif personnaliser. Utilisation des templates. mail_tt2/ : modèles de messages web_tt2/ : toute l'interface graphique families/ : fichier config.tt2 (modèle de config) Mails personnalisés. Le format utilisé. Jusqu'à version 4.x : format maison

nigel-davis
Download Presentation

Le mécanisme de templates de Sympa

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 13 juin 2007 1 Le mécanisme de templates de Sympa

  2. 13 juin 2007 2 Objectif personnaliser

  3. 13 juin 2007 3 Utilisation des templates • mail_tt2/ : modèles de messages • web_tt2/ : toute l'interface graphique • families/ : fichier config.tt2 (modèle de config) • Mails personnalisés

  4. 13 juin 2007 4 Le format utilisé • Jusqu'à version 4.x : format maison • Depuis, le format TT2 • Doc http://www.template-toolkit.org/ • La précédence s'applique : • distribution : ~sympa/default/ • installation : ~sympa/etc/ • robot : ~sympa/etc/dom1.fr/ • liste : ~sympa/expl/liste/ ou ~sympa/expl/dom1.fr/liste

  5. 13 juin 2007 5 La syntaxe TT2 • Utilisation des variables • [% var1 %] ou [% struct.var1 %] ou [% obj.var %] • [% var = valeur %] • Conditions • [% IF cond %]..[% ELSIF cond %]..[% ELSE %] [% END %] • Boucles • [%FOREACH %] ou [% WHILE %] • Inclusions • [% INCLUDE %] ou [% PROCESS %]

  6. 13 juin 2007 6 Exemple • [% IF var1 %] • [% FOREACH objet = var2.var3 %] • [% objet %] • [% END %] • [% ELSIF var4 %] • [% INCLUDE var5 %] • [% ELSE %] • Ne rien faire. • [% END %]

  7. 13 juin 2007 7 Notation propre à Sympa • Internationalisation : • [%|loc(var1,var2)%] bla %1, blo %2 [% END %] • le contenu de la balise pourra être extrait à fins d'internationalisation. • Q-encode : • [% FILTER qencode %]Message à modérer[%END%]

  8. 13 juin 2007 8 Structure des templates web • main.tt2 inclut • css.tt2 et javascript.tt2 • error.tt2 et notice.tt2 • $action.tt2 • menu.tt2, login_menu.tt2, list_menu.tt2 • your_lists.tt2, footer.tt2 • Beaucoup de choses sont personnalisables via les CSS

More Related