<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>Afficher les derniers articles publiés sauf une section</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>Bonjour la liste !</FONT>
<BR><FONT SIZE=2>Sur un CPS 3.2.4,</FONT>
<BR><FONT SIZE=2>je voudrais afficher la liste des 10 derniers documents publiés sur un site, sauf pour une section bien identifiée.</FONT>
<BR><FONT SIZE=2>Il y a une dizaine de sections sur le site, et 3 ou 4 sous-sections dans chaque section.</FONT>
</P>
<P><FONT SIZE=2>Je dispose de la macro suivante qui définit une boîte qui affiche les 10 derniers document publiés sur le site :</FONT>
</P>
<P><FONT SIZE=2><metal:block define-macro="basebox_last_articles"></FONT>
<BR><FONT SIZE=2> <div class="last_articles_box"</FONT>
<BR><FONT SIZE=2> tal:define="query python:{'portal_type':'',</FONT>
<BR><FONT SIZE=2> 'review_state' : 'published',</FONT>
<BR><FONT SIZE=2> 'sort_on' : 'Date',</FONT>
<BR><FONT SIZE=2> 'sort_order' : 'reverse'};</FONT>
<BR><FONT SIZE=2> last_news python:here.portal_catalog(**query);</FONT>
<BR><FONT SIZE=2> last_news python:test(len(last_news)>10, last_news[:10], last_news);"</FONT>
<BR><FONT SIZE=2> tal:condition="last_news"></FONT>
<BR><FONT SIZE=2> <div class="last_articles_title">Derniers articles parus</div></FONT>
<BR><FONT SIZE=2> <div class="last_articles_elem"</FONT>
<BR><FONT SIZE=2> tal:repeat="brain last_news"></FONT>
<BR><FONT SIZE=2> <a tal:attributes="href brain/getURL"</FONT>
<BR><FONT SIZE=2> tal:content="brain/Title | brain/getId" /><br /></FONT>
<BR><FONT SIZE=2> <span tal:replace="brain/Description" /></FONT>
<BR><FONT SIZE=2> </div></FONT>
<BR><FONT SIZE=2> </div></FONT>
<BR><FONT SIZE=2></metal:block></FONT>
</P>
<P><FONT SIZE=2>Je ne vois pas comment exclure une section de la recherche.</FONT>
<BR><FONT SIZE=2>Je suppose que cela se passe dans portal_catalog(**query) et dans la définition du query, mais je ne sais pas comment faire...</FONT></P>
<P><FONT SIZE=2>Fedora 3, Zope 2.7.3, CPS 3.2.4, python 2.3.4</FONT>
</P>
<P><FONT SIZE=2>Cordialement.</FONT>
</P>
</BODY>
</HTML>