Because we just could not put everything in SPIP 2.0 (the box was to small), here comes a plugin with little more tweaks in it ! Take it as a gift, with our kind regards !
How soft it is ! Is it new ?
According to its fans, SPIP-Bounce improves the comfort of your user experience with forms in the private area, whose colours last longer than before.
It is just a slight variation on the private area’s styles. This one now offers a new set of colours, softer for the eyes, leading to more concentration abilities on your editorial work. Bounce-gift : those forms stay accessible, even when pictures display is desactivated in the browser.
A loop (POUR) to get for... to... effects
A loop (POUR) (french equivalent for “FOR”) now lets you loop on all php arrays, although they are passed through #ENV, #GET or whatever.
- <BOUCLE_test(POUR){array #ENV{array}}>
- #KEY=>#VALUE<br />
- </BOUCLE_test>
KEY and VALUE can then be used in criterions, as for a certain number of criterions in traditionnal SPIP’s loops (pagination for exemple)
Those arrays might already be present in because they are brought as an argument for an include (#INCLURE), or as a context for a CVT form, or come from any filter returning a PHP array() : (#ENV{something}|my_filter), or at last, from every tag returning an array(), like #ARRAY ...
Numerous exemples available in the plugin’s /tests/ directory.
A loop (CONDITION) to get if... then... else... effects
- <BOUCLE_test(CONDITION){si #ENV{test}|>{5}}>
- true
- </BOUCLE_test>
- false
- <//B_test>
"si..." is the french for “if...”
Tags to play with arrays
SPIP already lets you initialize an array with
- #SET{my_array,#ARRAY{1,first_value,2,second_value,3,third_value}}
SPIP-Bounce adds a #SET_MERGE tag which allows to merge and to allocate a value at the same time.
- #SET_MERGE{name_of_my_array,#GET{my_array},#ARRAY{key,value}}
and a tag #SET_PUSH, to add any element to it :
- #SET_PUSH{my_array,value}
A new criterion compteur ( = counter)
Inspired by Classer les articles par nombre de commentaires, this criterion compteur lets you count elements issued from a table, associated to elements issued from another table.
For exemple, to display authors (AUTEUR) with their number of articles :
- <BOUCLE1(AUTEURS){compteur articles}{par compteur_articles}>
- #ID_AUTEUR : #COMPTEUR{articles}
- </BOUCLE1>
#COMPTEUR tag is associated to criterion and allows to display the counter value for each author.



Download the plgun SPIP-Bonux


Comment on this article