Jump to content

Problème page custom


Recommended Posts

Bonjour la communauté,

 

Voici mon problème.

J'ai besoin pour un client de créer plusieurs pages "customisée" avec le même Header et Footer..

 

Après avoir suivit plusieurs postes je reste avec une page blanche.

 

Voici mes manipulations.

 

Je crée un fichier NewPageController.php (dans controllers/front/..)

<?php

class NewPageControllerCore extends FrontController
{
  public $php_self = 'new-page.php';

  public function setMedia()
  {
		  parent::setMedia();
		  Tools::addCSS(_THEME_CSS_DIR_.'new-page.css');
		  Tools::addJS(_THEME_JS_DIR_.'new-page.js');
  }

  public function displayContent()
  {
		   parent::displayContent();
		   self::$smarty->display(_PS_THEME_DIR_.'new-page.tpl');
  }
}

Ensuite un fichier new-page.php ( à la racine prestashop )

<?php

require(dirname(__FILE__).'/config/config.inc.php');
ControllerFactory::getController('NewPageController')->run();

Et puis une page .tpl new-page.tpl (dans mon thème)

{capture name=path}{l s='NewPage'}{/capture}
{include file="$tpl_dir./breadcrumb.tpl"}

<h1>{l s='Custom new page'}</h1>

Enfin je crée une url simplifiée..

 

Et sur ma page 

http://localhost:8888/new-page

ou

http://localhost:8888/new-page.php

 

Rien ne s'affiche.. Page blanche

 

Une solution ? En sachant que je suis sur la nouvelle version 1.6 

 

Merci d'avance

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...