ansovell Posted June 21, 2011 Share Posted June 21, 2011 I have made a few pages in php, i wish I could load them into prestashop.Bone that I have in php page it appears as if the contents of the home page.How I can charge my php page home menus, the header and footer? Link to comment Share on other sites More sharing options...
shokinro Posted June 21, 2011 Share Posted June 21, 2011 this will be different in 1.3x and 1.4x because of the architecture is different.what PS version are you using?You can take a existing page as example.for 1.3x, you will need include header.php and footer.php in your PHP file.but before that there are a few files need to be included too, like config.inc.php and init.php include(dirname(__FILE__).'/config/config.inc.php'); include_once(dirname(__FILE__).'/init.php'); ....... include(dirname(__FILE__).'/footer.php'); for 1.4x, you will have to create your own pare controller to inherits FrontController class, and put it in /comntorllers folder.then in your PHP page, just call the your controller require(dirname(__FILE__).'/config/config.inc.php'); ControllerFactory::getController('YourPageController')->run(); Link to comment Share on other sites More sharing options...
ansovell Posted June 21, 2011 Author Share Posted June 21, 2011 Thanks for the reply!I have two stores and use version 1.3 and 1.4You could say all files are to be included?In 1.4 as I can find my 'YourPageController'? Link to comment Share on other sites More sharing options...
shokinro Posted June 21, 2011 Share Posted June 21, 2011 it depends on how many page you are going to integrated into.You can find detailed instructions for 1.3x with samle herefor example(1.4x), if you created a new page name mynewpage.php page.1. You will need to create a page controller file with name MyNewPageController.php, place this file in YourSiteRoot/controller/ folderyou MyNewPageController.php must be class the inherits from FrontController classand also implement/override some of the methods.2. you will need to create theme file mynewpage.tpl, you must put it under the theme folder/YourSiteRoot/themes/YourSiteTheme3. Create mynewpage.php file under your site root. require(dirname(__FILE__).'/config/config.inc.php'); ControllerFactory::getController('MyNewPage')->run(); Hope you can got some idea of it. Link to comment Share on other sites More sharing options...
ansovell Posted July 14, 2011 Author Share Posted July 14, 2011 mynewpage.tpl page as it should be? Link to comment Share on other sites More sharing options...
shokinro Posted July 14, 2011 Share Posted July 14, 2011 you have to call this theme file in your page controller in displayContent methodhere is the example. public function displayContent() { parent::displayContent(); self::$smarty->display(_PS_THEME_DIR_.'mynewpage.tpl'); } Link to comment Share on other sites More sharing options...
ansovell Posted July 14, 2011 Author Share Posted July 14, 2011 yes, but ...What content should have the tpl file?for example in the index.tpl file there is only{$ HOOK_HOME}thanks for the help Link to comment Share on other sites More sharing options...
shokinro Posted July 14, 2011 Share Posted July 14, 2011 the hook is used for modules.you can just put any contents like you put. Hello World! I am here If you want hook something, you need assign the hooks in the controller first. Link to comment Share on other sites More sharing options...
holle75 Posted October 28, 2011 Share Posted October 28, 2011 Hi there, i also try to create a custom page in 1.4.5.1 i created shop/hdmblog.php <?php /* * DISCLAIMER */ require(dirname(__FILE__).'/config/config.inc.php'); ControllerFactory::getController('hdmblogController')->run(); in shop/controllers/hdmblogController.php <?php /* * DISCLAIMER */ public function displayContent() { parent::displayContent(); self::$smarty->display(_PS_THEME_DIR_.'hdmblog.tpl'); } and in shop/themes/mytheme/hdmblog.tpl <p>testtext</P> i get a white page. Could somebody throw me a bone here, please? best regards H. Edit: as a final result later on i´m trying to get a page with a custom body but keeping "header" and "top of pages". Link to comment Share on other sites More sharing options...
Recommended Posts