SPIP

[ar] [ast] [bg] [br] [ca] [co] [cpf] [cs] [da] [de] [en] [eo] [es] [eu] [fa] [fon] [fr] [gl] [id] [it] [ja] [lb] [nl] [oc] [pl] [pt] [ro] [ru] [sk] [sv] [tr] [uk] [vi] [zh] Espace de traduction

Download

#FILTRE

August 2010

All the versions of this article:

#FILTRE{f} applies the filter named f to the entire template file once it has already been calculated.


This tag accepts a filter or a combination of filters as its argument.
E.g.

        #FILTRE{supprimer_tags|filtrer_entites|trim}

Located at the end of a template file, it applies its parameter (or multiple parameters) as a filter to the entire generated template file once it has been processed by SPIP’s regular HTML-generating engine.

Important note: This filtering applies to the #INCLURE in the template files that use this tag, but does not apply to the <INCLURE> contained within the template file.

Example 1: In SPIP2, compression was not a configurable option in the SPIP’s private zone, but it was still possible to compact any CSS and JavaScript files using the following instruction #FILTRE{compacte_head} inserted at the end of the inc-head.html template file.

Example 2: In the notification plugin, an inscription.html template file generates the contents of an email. To make this content suitable for an email, the results of the template file are processed by a series of filters aiming to remove HTML tags, redundant spaces and HTML entities: #FILTRE{supprimer_tags|filtrer_entites|trim} [1].


Show the template of this page Site powered by SPIP | Translation area | Private area