Coding with SPIP 3.0
SPIP3.0 Technical Documentation

> > > > insert_head_css

insert_head_css

The insert_head_css pipeline is used by plugins to insert the CSS files that they need to operate correctly into the section of the SPIP template that includes the #INSERT_HEAD_CSS tag if there is one, and if not then at the start of the code included using the #INSERT_HEAD tag. This allows a template to indicate a specific location for additionally loaded CSS code.

It is called quite simply by using:

  1. return pipeline('insert_head_css', '');

Example

The "Porte Plume" extension uses it in a simplified manner to add two CSS files, the second being a SPIP template file:

  1. function porte_plume_insert_head_css($flux) {
  2. $css = find_in_path('css/barre_outils.css');
  3. $css_icones = generer_url_public('barre_outils_icones.css');
  4. $flux .= "<link rel='stylesheet' type='text/css' media='all' href='$css' />\n"
  5. . "<link rel='stylesheet' type='text/css' media='all' href='$css_icones' />\n";
  6. return $flux;
  7. }

Download

  • Author :
  • Published :
  • Updated : 29/05/10
  • Translations : English, français