Hi,
you can use {doublons} to store the elements given by a first loop, and loop over them in a second one.
ex.
[(#REM) ]
<BOUCLE_store(ARTICLES){id_section}>
<BOUCLE_doc_art(DOCUMENTS){id_articles}{mode=image}{extension==jpg|png|gif}{doublons A}> </BOUCLE_doc_art>
</BOUCLE_store>
[(#REM) ]
<BOUCLE_doc(DOCUMENTS){! doublons A}{par date}{inverse}{0,50}>
…
</BOUCLE_doc>
But the problem of this method is that the first step looks for documents in all your articles. This is time consuming
So you can use a JOIN between spip_documents and spip_articles. The performance is better.
Sorry, this is a really poor documented feature (even in french) that appears with SPIP1.9 :
http://www.spip.net/en_article3416.html (chap. « automatic detection of tables SQL and joints »)
<BOUCLE_doc(DOCUMENTS articles){id_secteur}{mode=image}{extension==jpg|png|gif}{par date}{inverse}{0,50}>
…
</BOUCLE_doc>
{id_secteur} isn’t a criteria for DOCUMENTS loops, but spip automatically finds that some articles are related to documents, and use this criteria for the articles.
Normally, the other cirteria should be applied to documents
Note that you can use « DOCUMENTS » and « articles » because the are standard tables (you can use SPIP_DOCUMENTS ad spip_articles if you want, but it’s not necessary)
Hope it helps,
.Gilles
On Sat, Jan 10, 2009 at 3:30 PM, TN Media <info@tnmedia.net> wrote:
Dear all
I have another question:
Can I create a boucle to list out all Documents belong to articles of a given section?
Say, given rubrique=3, I would like to display the latest 50 documents attached to articles of this rubrique.
using this loop below, would give me documents of ALL articles accross the site, which I want to narrow down to a given section.
<BOUCLE_doc(DOCUMENTS){mode=image}{extension==jpg|png|gif}{par date}{inverse}{0,50}>
…
</BOUCLE_doc>
Also, instead of rubrique, what about keyword? Say I want to list out the latest 50 documents attached to those articles with mot=5 ??
Thanks in advance 
Vinc.
spip-en@rezo.net - http://listes.rezo.net/mailman/listinfo/spip-en