Jump to content

Loading a different header.tpl file for custom page (1.4.8.2)


TailgunnerMedia

Recommended Posts

I am using PrestaShop 1.4.8.2. I have created a custom page using the following code in a new php file

<?php

include(dirname(__FILE__).'/config/config.inc.php');

include(dirname(__FILE__).'/header.php');

$smarty->display(_PS_THEME_DIR_.'patrolseries.tpl');

include(dirname(__FILE__).'/footer.php');?>

The page loads fine and I can add content to it using the patrolseries.tpl file. My problem is I would like to use a different header.tpl file for this page but I don't know how to go about accomplishing that. Any help/guidance would be great. Thanks!

Link to comment
Share on other sites

hello

 

if I were you i will modify FrontController.php file

 

there is a function: public function displayHeader()

modify it to: public function displayHeader($other_template=null)

 

inside you've got:

self::$smarty->display(_PS_THEME_DIR_.'header.tpl');

change it to:

if ($other_template==1){
self::$smarty->display(_PS_THEME_DIR_.'header.tpl');
} else {
self::$smarty->display(_PS_THEME_DIR_.'header.tpl');
}

then create header2.php file with code:

$controller = new FrontController();
$controller->displayHeader(1);

and include it instead of header.php

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...