<!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>&lt;metal:block define-macro=&quot;basebox_last_articles&quot;&gt;</FONT>
<BR><FONT SIZE=2>&nbsp; &lt;div class=&quot;last_articles_box&quot;</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp; tal:define=&quot;query python:{'portal_type':'',</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'review_state' : 'published',</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'sort_on' : 'Date',</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'sort_order' : 'reverse'};</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; last_news python:here.portal_catalog(**query);</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; last_news python:test(len(last_news)&gt;10, last_news[:10], last_news);&quot;</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp; tal:condition=&quot;last_news&quot;&gt;</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp; &lt;div class=&quot;last_articles_title&quot;&gt;Derniers articles parus&lt;/div&gt;</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp; &lt;div class=&quot;last_articles_elem&quot;</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tal:repeat=&quot;brain last_news&quot;&gt;</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;a tal:attributes=&quot;href brain/getURL&quot;</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tal:content=&quot;brain/Title | brain/getId&quot; /&gt;&lt;br /&gt;</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;span tal:replace=&quot;brain/Description&quot; /&gt;</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp; &lt;/div&gt;</FONT>
<BR><FONT SIZE=2>&nbsp; &lt;/div&gt;</FONT>
<BR><FONT SIZE=2>&lt;/metal:block&gt;</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>