Private area
The private area has been improved in many places with asynchronous (AJAX/AHAH) updates of a part of a page. This improves the fluidity of the images, document description boxes, of adding keywords and authors, as well as the rapidity of the translation linking mechanism.
A system of models
Models are mini-templates that can be integrated easily in a normal template, and — more importantly — in the text of the articles (or news items, etc.).
Models are a natural extension to the <img1|left>
and <doc1|center>
shortcuts. Therefore, these shortcuts are now managed as models and can be easily modified (or new shortcuts created) by placing your own mini-template in the sub-directory modeles of your "squelettes" directory (or in a plugin).
In addition to the shortcuts for documents and images, the default models proposed in dist/modeles/ also manage the pagination links, the tag #LESAUTEURS
(that displays the list of authors of an article) and the translation links.
A thorough documentation of the model system is provided by the article «Utiliser les modèles» (not yet translated).
New tags
-
#SPIP_VERSION
shows the version of SPIP installed. -
#INSERT_HEAD
: This is a tag that can be placed into the<head>...</head>
part of your templates to enable independent plugins to insert new css stylesheets and javascript into your templates. -
#INCLURE
: a new tag to do static inclusions, in contrast to the dynamic inclusions of<INCLUDE{fond=...}>
.Note : the notation
<INCLURE{fond=..}>
causes the inclusion of an independent template at every visit from a user, even if the page is already in the cache.
With the new tag[(#INCLURE{fond=...})]
, the inclusion is performed when the cache is generated from the template and the result is stored in the cache of the calling page. With this system, the life span (delay of the cache refreshing, usually set by:$delais
or#CACHE{}
) of the statically included template cannot be set independently [1] from its including template. However, this type of inclusion enables the application of filters to the whole included template:[(#INCLURE{fond=letter}|version_texte)]
. - Pagination is now managed by the “model” system (see the previous section), so it can now be customised with your own models. Therefore:
-
#PAGINATION{page}
displays the number of the pages (1, 2, 3, 4...) instead of the numbers of items per page (0, 10, 20, ...) ; - you can also try:
#PAGINATION{page_precedent_suivant}
(to have links to the previous/next pages as well as page numbers) and#PAGINATION{precedent_suivant}
(to have links only to the previous/next pages).
-
-
#SQUELETTE
returns the path to the current template.
New filters
The image_masque filter has been enhanced:
- the horizontal alignment of the mask can be controlled by:
-
text-align=center
(or left, or right) -
vertical-align=middle
(or top, or bottom)
-
- You can now control the mode of merging of the mask with the image (in the same way that it can be done with layers in the Gimp). By default, with no parameters, you’ll get
mode=masque
which is the usual mask mode.
The new modes are:-
mode=normal
the image is simply placed on top of the other; -
mode=eclaircir
only the lighter pixels are placed; -
mode=obscurcir
only the darker pixels are placed; -
mode=produit
the original pixel is “multiplied” by the pixel of the mask. Therefore the black pixels make the image black (*0), the white pixels make do not modify the image (*1); -
mode=difference
the result is the difference of the two images.
-
Extension of the filters to texts:
All the image filters can now be applied to image files, tags <img src='..' ../>
, or complete texts (the filter is then applied to every image found in the text). So, you can use: [(#TEXTE|image_sepia)]
.
Other filters have been introduced and will be documented soon.
Advanced/Technical [2] novelties
The formulaires/ directory
Personalised forms (their html part) need to be placed in a sub-directory formulaires/ of your “squelettes” directory (or of a plugin). The php (for the processing) part of the form can be personalised by placing it in a sub-directory balise/ of your “squelettes” directory (or of a plugin).
You can now compute a template from the private area
Plugin developers can use the function recuperer_fond
to compile a template from the private area. This is the method used by the new tag #INCLURE
and the model system.
New tags
New tags that make it possible to do computations in the templates and to set variables have been introduced. You can therefore set a variable in one place of your template and retrieve it in a subsequent part of the same template by using
#SET{variable, value}
and #GET{variable}
.
Partial reload of a page (experimental)
Any loop can now be declared as a fragment that can be dynamically reloaded independently from the rest of the template — using asynchronous JavaScript (AHAH/AJAX).
This is achieved by placing the new criterion {fragment}
on the loop (the {pagination}
criterion implies the {fragment}
criterion). All the content of the loop (including what is in the before, after and alternative parts of the loop) is then included in a DIV with the class fragment
and a unique id:
<div id="fragment_html_1c4f894574d730e016e980d91fa678ca_articles" class="fragment">
...
By calling the URL of the page with an additional parameter var_fragment
specifying the id of one of this div (ex : &var_fragment=fragment_html_1c4f894574d730e016e980d91fa678ca_articles), the server will only return this fragment of the template. So it is easy to reload only small parts of the page.
Note: This is an experimental feature and will probably evolve greatly in future versions. You are still encouraged to play with it and provide feedback and code to improve it’s usability.
Le mode XHTML Tidy
Tidy mode (see article 3070) is no longer included by default in SPIP and is now a plugin. This is for three reasons:
- this code is depends on a programme which not all ISPs provide, and the mode php_tidy is not always functional either;
- the new template system has now become far more XHTML compliant, thus reducing the interest of tidy;
- the debugger (accessible by adding
&var_mode=debug
in the URL of a page) now includes its own tool to detect invalid html tags and their lines in the template (add$xhtml='spip_sax';
in yourmes_options.php
to activate this).
Code documentation:
A website to document the code of SPIP’s kernel has been set up at http://doc.spip.org:
- every function is referenced in an automatic way and a link is provided from the documentation (to the code) and in the code (to the documentation)
- the site is updated dally to follow the development (SVN) version of SPIP.
Fixes
A large number of bugs have been corrected (in particular ones concerning syndication, the cache of typographic images and the language menu). For more information, see the development website: http://trac.rezo.net/trac/spip/report/6.
Compatibility with the providers free and club-internet has been fixed.
* * *
If you do an update of your site from an old version of SPIP, please read the article SPIP 1.9.
Read also :
As usual, in case of difficulty, you can find help on the mailing lists: spip-en@rezo.net, spip@rezo.net and on the forums.