Jump to content

Custom page does not have $page_name set


jrstafford1

Recommended Posts

I used some code I found online somewhere to create a custom page for my 1.6.0.9 install.  I created a php file in the root that contains the following code.

 

<?php
include(dirname(__FILE__).'/config/config.inc.php');
Tools::displayFileAsDeprecated();

include(dirname(__FILE__).'/header.php');
$smarty->display(_PS_THEME_DIR_.'documentation.tpl');
include(dirname(__FILE__).'/searchdocs/search.php');
include(dirname(__FILE__).'/footer.php');
?>

I also created a controller and a template file.  The controller init function looks like this...

 

    public function init(){
        $this->page_name = 'documentation';
        parent::init();
    }

I also tried setting a public global $page_name variable but that had no effect.

 

So the trouble I'm having is the body class ends up being 'pagenotfound' and I believe this is causing an issue where hook_header does not insert the javascript file references.  The page loads but some of the javascript functionality is not working since the files are not being loaded.  The javascript file references are not being inserted, I have verified that, and I think it may have something to do with the page_name not being set but I'm not 100% sure that is the issue.  Any help would be greatly appreciated!

 

 

 

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