Sites Web : Programmer avec SPIP

Publié le vendredi 27 février 2009

⇒ https://programmer.spip.org/

SPIP est un système de publication et une plateforme de développement. Après un rapide tour d’horizon de SPIP, nous décrirons son fonctionnement (…)

Articles syndiqués tirés de ce site

Passage d’arguments aux fonctions CVT
Août 2009, par Matthieu Marcillaud
Les fonctions charger(), verifier() et traiter() ne reçoivent par défaut aucun argument. /** * GeSHi (c) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann * (http://qbnz.com/highlighter/ and http://geshi.org/) */ .php.php .imp font-weight : bold ; color : red ; .php.php .kw1 color : #b1b100 ; (…)
Overriding a file
Mai 2009, par Thomas Sutton
One of the first possibilities to modify SPIP’s behaviour is to copy one of its files from ecrire/ into a folder with higher priority — a plug-in or squelettes/ folder, for example — while preserving the folder hierarchy. Thus, one could modify the way in which SPIP manages the cache by copying (…)
Overloading a _dist function
Mai 2009, par Thomas Sutton
Many of the functions in SPIP are designed to be overridden. These functions have the extension “_dist” in their name. All the balises (“tags”), boucles (“loops”), and criteres (“criteria”) are named like this and can thus be overridden by declaring (perhaps in the file mes_fonctions.php) the (…)
Declaring new functions
Mai 2009, par Thomas Sutton
The “_fonctions” files are loaded automatically by SPIP, but — unlike the “_options” files — only when it needs to evaluate a template to generate a new page. These files make it possible, for example, to define new filters that can be used in templates. If you create a (…)
Declaring options
Mai 2009, par Thomas Sutton
When a visitor requests a page (whether or not it is in the cache), SPIP carries out a number of actions, one of which is to load the “options” files. In these files we can, for example, define new constants or modify global variables that control the way SPIP operates. These options can be (…)
Templates or plug-ins ?
Mai 2009, par Thomas Sutton
Use the "squelettes" folder The squelettes/ folder allows to store all the files required for the operation of your site and of its graphic design : templates (or “squelettes”, images, javascript and css files, php libraries, …). Or create a plug-in A plug-in, stored in a folder like (…)
The concept of path
Mai 2009, par Thomas Sutton
SPIP uses a large number of functions and templates, contained in various folders. When a script needs to open a file to load a function or to read a template, SPIP will search for it in one of a number of folders. The first matching file found in one of these will be loaded and used. The (…)
Affichage conditionnel
Avril 2009, par Matthieu Marcillaud
Les fonctions charger() ou traiter() peuvent indiquer dans leur réponse que le formulaire est éditable ou non. Cela se traduit par la réception d’un paramètre editable dans le squelette, qui peut servir à masquer ou non le formulaire (mais pas les messages d’erreur ou de réussite). Il s’utilise (…)
Expliquer les saisies
Avril 2009, par Matthieu Marcillaud
Il est souvent nécessaire de donner une explication pour remplir correctement une saisie de formulaire. SPIP propose une écriture pour cela, à insérer comme classe CSS dans une balise : explication permet d’écrire une explication plus détaillée que le label du champ souhaité attention met en (…)
Champs radio et checkbox
Avril 2009, par Matthieu Marcillaud
Pour afficher des listes d’éléments de type radio ou checkbox, une syntaxe est proposée en encadrant les éléments d’une . Cette écriture permet d’avoir le bouton avant le label, d’avoir la liste radio en horizontal (via CSS). /** * GeSHi (c) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann * (…)
Revenir en haut