edevuk Posted April 4, 2013 Share Posted April 4, 2013 Hi, In older versions of prestashop I successfully 'wrapped' custom php pages that contained scripts within a Prestashop theme by including the config.php, header.php and footer.php on each page I wanted the theme. With Prestashop 1.5 or above, I understand that I can create a controller for a single custom page. However, can I use one controller for multiple pages? I have a custom app that I'd like to run within the Prestashop template, though this app is made of many php pages and I'm hoping there is a better way to do this than creating a controller for each php page. For example, can I use a single controller to include the content from various php scripts? Or is there a way to 'wrap' custom content easily within a Prestashop 1.5 template? If there any Prestashop experts available to help with this immediately I am happy to pay for your service. (And there is more work to come!) Thanks, Adam Link to comment Share on other sites More sharing options...
vekia Posted April 4, 2013 Share Posted April 4, 2013 <?php require_once(dirname(__FILE__).'config/config.inc.php'); require_once(dirname(__FILE__).'init.php'); $context = Context::getContext(); $fc=new Frontcontroller(); $fc->setmedia(); $context->smarty->display(dirname(__FILE__).'/your-tpl-file.tpl'); require_once(dirname(__FILE__).'footer.php'); and you've got working new page :-) 1 Link to comment Share on other sites More sharing options...
netplayer Posted April 9, 2013 Share Posted April 9, 2013 On 4/4/2013 at 11:35 PM, vekia said: <?php require_once(dirname(__FILE__).'config/config.inc.php'); require_once(dirname(__FILE__).'init.php'); $context = Context::getContext(); $fc=new Frontcontroller(); $fc->setmedia(); $context->smarty->display(dirname(__FILE__).'/your-tpl-file.tpl'); require_once(dirname(__FILE__).'footer.php'); and you've got working new page :-) Great example but. doesnt work for me. Even just with no .tpl content the page is messed up (default prestashop 1.5.4 theme). Link to comment Share on other sites More sharing options...
Recommended Posts