Paul | 5 Jun 17:32
Picon

combine two loops?

Hi, is there a way to combine results from two different loops?

For example, what if I want to get all articles with a keyword id of 222 plus those belonging to section 74 (not necessarily with the keyword 222)

This code below does not work since it only gets articles with id_mot=222  and also having id_rubrique=74:

   <BOUCLE_articles_action(ARTICLES) {par date}{inverse}{id_rubrique=74}{id_mot=222}>
       <div>
           <span><a href="#URL_ARTICLE">#TITRE</a></span>
       </div>
   </BOUCLE_articles_action>


Of course the usual method is to generate two loops- one for id_rubrique=74 and another for id_mot=222, the problem is if you want to use only one loop for sorting and pagination purposes.

Is this not possible in SPIP?  Help would be greatly appreciated.

Thanks,
Paul

Gilles VINCENT | 5 Jun 17:45
Picon
Gravatar

Re: combine two loops?

Hi,


there is a criteria IN that enables you to do this
{xxxx IN a,b,c,d,....}

(In your case : {id_mot IN 222,74} )

.Gilles


On Fri, Jun 5, 2009 at 5:32 PM, Paul <npaulp-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Hi, is there a way to combine results from two different loops?

For example, what if I want to get all articles with a keyword id of 222 plus those belonging to section 74 (not necessarily with the keyword 222)

This code below does not work since it only gets articles with id_mot=222  and also having id_rubrique=74:

   <BOUCLE_articles_action(ARTICLES) {par date}{inverse}{id_rubrique=74}{id_mot=222}>
       <div>
           <span><a href="#URL_ARTICLE">#TITRE</a></span>
       </div>
   </BOUCLE_articles_action>


Of course the usual method is to generate two loops- one for id_rubrique=74 and another for id_mot=222, the problem is if you want to use only one loop for sorting and pagination purposes.

Is this not possible in SPIP?  Help would be greatly appreciated.

Thanks,
Paul

_______________________________________________
spip-en-JM9gtpQu/Ho@public.gmane.org - http://listes.rezo.net/mailman/listinfo/spip-en


Fil | 5 Jun 22:36
Favicon
Gravatar

Re: combine two loops?

> For example, what if I want to get all articles with a keyword id of 222 plus
> those belonging to section 74 (not necessarily with the keyword 222)

The answer is to use anti-doublons:

<BOUCLE1(ARTICLES){first criterion}{doublons x} />
<BOUCLE2(ARTICLES){second criterion}{doublons x} />

<BOUCLE_sum(ARTICLES){!doublons x}>
#TITRE
</BOUCLE_sum>

-- Fil
Paul | 6 Jun 10:24
Picon

Re: combine two loops?

Thanks guys!

Gilles' suggestion on using the IN criteria does not work for my purposes since {id_mot IN 222,74} ) can only return articles with the keywords 222 or 74. I need to get articles with the section id of 74....

Fil's solution worked brilliantly though. I would never have thought of it since I didn't think a negation of the doublons criteria is possible. I don't think this is in the English documentation of SPIP.

Thanks a lot for all your suggestions! This saved me from doing some messy php coding instead.

Paul

klaus++ | 7 Jun 14:33
Picon
Gravatar

Re: combine two loops?

Hi Fil,

your solution, is it mentioned in the doc ? I understand that SPIP 
stores the values of the doublons in a table / an array which one may 
examine in a third loop.

Therefore {doublons x} means "get everythin exept the objects in array 
x" - and {!doublons x} means get exverything in array  x - am I right?

BTW is it possible to do somethin like

<BOUCLE1(ARTICLES){criterion}{doublons x} /></BOUCLE1>
<BOUCLE2(RUBRIQUES){criterion}{doublons x} /></BOUCLE2>
<BOUCLE_sum(ARTICLES, RUBRIQUES){!doublons x}{par titre}>
#TITRE
</BOUCLE_sum>

in order to obtain an ordered list of sections's and article's titles?

Thank you very much,
klaus++

Fil schrieb:
>> For example, what if I want to get all articles with a keyword id of 222 plus
>> those belonging to section 74 (not necessarily with the keyword 222)
> 
> The answer is to use anti-doublons:
> 
> <BOUCLE1(ARTICLES){first criterion}{doublons x} />
> <BOUCLE2(ARTICLES){second criterion}{doublons x} />
> 
> <BOUCLE_sum(ARTICLES){!doublons x}>
> #TITRE
> </BOUCLE_sum>
> 
> 
> -- Fil
> _______________________________________________
> spip-en@... - http://listes.rezo.net/mailman/listinfo/spip-en
> 
> 
Gilles VINCENT | 7 Jun 17:37
Picon
Gravatar

Re: combine two loops?

Hi,


The documentation (either french of english) is incomplete (http://www.spip.net/en_article2085.html#doublons), and doesn't explains how (!doublons} can be used.
 
You can find some advanced usages of {doublons} on this page of SPIP-CONTRIB : 

On Sun, Jun 7, 2009 at 2:33 PM, klaus++ <klaus-s6KTOw/FEIw@public.gmane.org> wrote:
Therefore {doublons x} means "get everythin exept the objects in array x" - and {!doublons x} means get exverything in array  x - am I right?

exactly.
 

BTW is it possible to do somethin like

<BOUCLE1(ARTICLES){criterion}{doublons x} /></BOUCLE1>
<BOUCLE2(RUBRIQUES){criterion}{doublons x} /></BOUCLE2>
<BOUCLE_sum(ARTICLES, RUBRIQUES){!doublons x}{par titre}>
#TITRE
</BOUCLE_sum>

in order to obtain an ordered list of sections's and article's titles?

No
{doublons} can only store objects of the same type. 

Your latest loop will try to create a joint query between spip_articles and spip_rubriques, but won't work : 'titre' is a field that exists in each table and you must precise which on you want to use.

.Gilles
--
 

Thank you very much,
klaus++



Fil schrieb:

For example, what if I want to get all articles with a keyword id of 222 plus
those belonging to section 74 (not necessarily with the keyword 222)

The answer is to use anti-doublons:

<BOUCLE1(ARTICLES){first criterion}{doublons x} />
<BOUCLE2(ARTICLES){second criterion}{doublons x} />

<BOUCLE_sum(ARTICLES){!doublons x}>
#TITRE
</BOUCLE_sum>


-- Fil
_______________________________________________
spip-en-JM9gtpQu/Ho@public.gmane.org - http://listes.rezo.net/mailman/listinfo/spip-en


_______________________________________________
spip-en-JM9gtpQu/Ho@public.gmane.org - http://listes.rezo.net/mailman/listinfo/spip-en

Gilles VINCENT | 14 Jun 10:20
Picon
Gravatar

external image of SPIP, compared to other CMS : what do you think about it ?

Hello, 


I started a discussion in the list spip-dev, and would like to have your opinion : 
(automatic translation here : http://tinyurl.com/lmeqo7)

This was in reaction to a discussion about to name to give to a new functionality in SPIP : themes in the private area.

In your opinion, which impression of SPIP can be perceived by non-french speaking developers ?

-- especially you may feel concerned by this message from Klauss, who is German, http://article.gmane.org/gmane.comp.web.spip.devel/53825 --
(automatic translation here : http://tinyurl.com/mvqfyj)


Thanks for reacting,



.Gilles
Heiko Jansen | 14 Jun 11:35
Picon

Re: external image of SPIP, compared to other CMS : what do you think about it ?

Hi Gilles,

I developed some websites in Germany with SPIP and I used SPIP because
of its intuitive "Back-Office" - it's well designed and simple to use.
It's build for humans not for IT-professionals... and so after a short
introduction everybody of my customers can work with SPIP and change
the content of their sites.

For me as an foreign developer the language of the internal "script
language" is mostly irrelevant. Well, starting with SPIP you need a
time of familiarisation but then it's okay. You have to learn some
things for every CMS, and so you learn to write BOULCE instead of LOOP
or #TEXTE instead of #TEXT.

More disturbing for me is the lack of an consistent documentation for
non-french speaking developers. Since Version 1.8 SPIP made some very
big steps in the development - e.g. the Plugin-System etc. pp. But the
documentation was not to made these big steps. So the documentation
now is a patchwork with a lot of missing links. So I now that there
are powerful Plugins, but they are not well documented nor they are
translated - so I can't use them, because this is destroying the
easy-to-use-backoffice. I can't explain my customers that their is a
very cool function but only in french...

So - don't get worried about the names of internal scripts - that is
not the problem. The problem is, that the documentation for developers
doesn't made the huge steps of the deveolpment of SPIP: SPIP is like a
TGV and the documantion is more like a 2CV...

Greetings from Bochum
Heiko

2009/6/14 Gilles VINCENT <gilles.vincent@...>:
> Hello,
> I started a discussion in the list spip-dev, and would like to have your
> opinion :
> http://thread.gmane.org/gmane.comp.web.spip.devel/53775
> (automatic translation here : http://tinyurl.com/lmeqo7)
> This was in reaction to a discussion about to name to give to a new
> functionality in SPIP : themes in the private area.
> In your opinion, which impression of SPIP can be perceived by non-french
> speaking developers ?
> -- especially you may feel concerned by this message from Klauss, who is
> German, http://article.gmane.org/gmane.comp.web.spip.devel/53825 --
> (automatic translation here : http://tinyurl.com/mvqfyj)
>
> Thanks for reacting,
>
>
> .Gilles
>
> _______________________________________________
> spip-en@... - http://listes.rezo.net/mailman/listinfo/spip-en
>
>
Martín Gaitán | 14 Jun 16:43
Picon
Gravatar

Re: external image of SPIP, compared to other CMS : what do you think about it ?

On Sun, Jun 14, 2009 at 5:20 AM, Gilles VINCENT<gilles.vincent <at> gmail.com> wrote:
> Hello,
> I started a discussion in the list spip-dev, and would like to have your
> opinion :
> http://thread.gmane.org/gmane.comp.web.spip.devel/53775
> (automatic translation here : http://tinyurl.com/lmeqo7)
> This was in reaction to a discussion about to name to give to a new
> functionality in SPIP : themes in the private area.
> In your opinion, which impression of SPIP can be perceived by non-french
> speaking developers ?
> -- especially you may feel concerned by this message from Klauss, who is
> German, http://article.gmane.org/gmane.comp.web.spip.devel/53825 --
> (automatic translation here : http://tinyurl.com/mvqfyj)
>
> Thanks for reacting,
>
>
> .Gilles

Gilles, thank you very much for stand up to this big problem.

I've left a comment a few days ago, in the article about the new site
'spip-info.net'
http://www.spip-contrib.net/Spip-info#forum417154

As answer, I get a "feel free to translate it". =D

I'm one of the most 'activist' spipers in spip-es (I'm from
Argentina). Altough I've translated (really 'interpreted', with the
help of automatic translators) documentation and contribs in french I
judged very important, this task is not accessible to the most people.
At this moment, the documentation in spanish is really outdated and
messy.

Obviously, the webmasters who know (or suspects) the potential of
spip, make the (big) effort to overpass this obstacle, but I'm sure
there is a lot of developers who stop at the door.

Just make a comparative how many contributors (of themes, plugins, ...
) there is in other projects (Wordpress, drupal, etc). ¿is that
because the quality? Obviously not.

So, my vote is +1 (or +1million if it's possible to vote more than once)

good sunday.
martin.
_______________________________________________
spip-en <at> rezo.net - http://listes.rezo.net/mailman/listinfo/spip-en
Valéry | 14 Jun 17:36
Picon
Gravatar

Re: external image of SPIP, compared to other CMS : what do you think about it ?

Martín Gaitán <gaitan@...> writes:

> I've left a comment a few days ago, in the article about the new site
> 'spip-info.net'
> http://www.spip-contrib.net/Spip-info#forum417154
> 
> As answer, I get a "feel free to translate it". =D

Yes :-)

How is it a wrong answer ? Someone has to do it.

If there are others willing to translate spip-info. I would gladly help from 
French to English, although some language washing maube helpful, but there is a 
need for a community to deal with maintaining a localized version.

About the technical documentation, I think a part of http://programmer.spip.org/ 
has been translated already.

_______________________________________________
spip-en <at> rezo.net - http://listes.rezo.net/mailman/listinfo/spip-en

Gmane