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:

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:

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

Author Mark Baber Published : Updated : 29/05/10

Translations : English, français