Jump to content

Multiple Custom Pages with PHP Content


Recommended Posts

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

<?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 :-)

  • Like 1
Link to comment
Share on other sites

  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

×
×
  • Create New...