Créer des sous-liens depuis la page index PHPBoost

Créer sa page



Pour créer des pages supplémentaires, en chargeant l'environnement de PHPBoost il vous faudra procéder de cette manière :

Les fichiers sont commentés de manière à ce que vous puissiez comprendre leur fonctionnement.

Code PHP :
<?php
/*##################################################
 *                               accueil.php
 *                            -------------------
 *   begin                : July 11, 2009
 *   copyright          : (C) 2007 Viarre régis
 *   email                : [email protected]
 *
 *  
 *
###################################################
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
###################################################*/
 
 
define('PATH_TO_ROOT', '.');
//Début du chargement de l'environnement
include_once('./kernel/begin.php');
//Chargement d'un fichier css, ici le fichier css du module news
define('ALTERNATIVE_CSS', 'news');
//Titre de la page, ici Accueil
define('TITLE', 'Accueil');
//Chargement de l'environnement ( le haut du site qui contient la bannière)
require_once('./kernel/header.php');
//Chargement des fichiers de langue
global $LANG;
//Chargement d'u fichier tpl ( non actif ici, pour le rendre actif supprimer "//"
 //$tpl_accueil = new Template('accueil/accueil.tpl');
## Début du contenu de la page ##
## Fin du contenu de la page ##
 
//Fin du chargement du tpl ( voir plus haut )
//$tpl_accueil->parse();
//Chargement du Footer (le pied de page du site)
include_once('./kernel/footer.php');
?>


Ceci ne fonctionne seulement si le fichier php est à la racine de votre site

Comment intégrer les liens en sous menu ?



Explication:



Si vous voulez faire des sous liens de cette manière : accueil > news > accueil

Il vous suffira simplement d'intégrer dans votre page :


Code PHP :
$Bread_crumb->add('Page 1', PATH_TO_ROOT . '/dossier/fichier1.php');
$Bread_crumb->add('Page 2', PATH_TO_ROOT . '/dossier/fichier2.php');
 



Résultat:




Code PHP :
<?php
/*##################################################
 *                               accueil.php
 *                            -------------------
 *   begin                : July 11, 2009
 *   copyright          : (C) 2007 Viarre régis
 *   email                : [email protected]
 *
 *  
 *
###################################################
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
###################################################*/
 
 
define('PATH_TO_ROOT', '.');
//Début du chargement de l'environnement
include_once('./kernel/begin.php');
//Chargement d'un fichier css, ici le fichier css du module news
define('ALTERNATIVE_CSS', 'news');
//Titre de la page, ici Accueil
define('TITLE', 'Accueil');
// Pages et Sous liens
$Bread_crumb->add('Page 1', PATH_TO_ROOT . '/dossier/fichier1.php');
$Bread_crumb->add('Page 2', PATH_TO_ROOT . '/dossier/fichier2.php');
//Chargement de l'environnement ( le haut du site qui contient la bannière)
require_once('./kernel/header.php');
//Chargement des fichiers de langue
global $LANG;
//Chargement d'u fichier tpl ( non actif ici, pour le rendre actif supprimer "//"
 //$tpl_accueil = new Template('accueil/accueil.tpl');
## Début du contenu de la page ##
## Fin du contenu de la page ##
 
//Fin du chargement du tpl ( voir plus haut )
//$tpl_accueil->parse();
//Chargement du Footer (le pied de page du site)
include_once('./kernel/footer.php');
?>


Pour toutes questions sur ce sujet, n'hésitez pas à poster sur le forum :)
Cette page a été consultée 2150 fois