Coding with SPIP 3.0
SPIP3.0 Technical Documentation

> > > > The information panel

The information panel

To add a page description, or a description of the object/id_object currently being shown, a type of insert panel has been envisaged: "boite_infos" (info_box)

It is often used in a way to add a function into the left column:

  1. // left column
  2. echo debut_gauche('', true);
  3. echo cadre_nom_infos();
  4. echo pipeline('affiche_gauche', array('args'=>array('exec'=>'nom'),'data'=>''));

Download

This function calls the pipeline and returns its contents in a panel:

  1. // display the page information
  2. function cadre_champs_extras_infos() {
  3. $boite = pipeline ('boite_infos', array('data' => '',
  4. 'args' => array(
  5. 'type'=>'nom',
  6. // possibly the object's ID and the SQL line
  7. // $row = sql_fetsel('*', 'spip_nom', 'id_nom='.sql_quote($id_nom));
  8. 'id' => $id_nom,
  9. 'row' => $row,
  10. )
  11. ));
  12. if ($boite)
  13. return debut_boite_info(true) . $boite . fin_boite_info(true);
  14. }

Download

The pipeline automatically loads a template (with the context supplied by the args array) of the same name to the "type" parameter in the prive/infos/ directory i.e. prive/infos/nom.html. It must then be created with the desired content.

  • Author :
  • Published :
  • Updated : 12/05/17
  • Translations : English, français