wstar Posted May 15, 2015 Share Posted May 15, 2015 I've been searching a while for this and I can not seem to get it working. I have already created a new tab under Customers called Teams. Creating a module which adds the new tab and also loads a .tpl file when clicking on the new tab. File Structure lgs_teamslgs_teams.php icon.png controller adminAdminTeamsController.php views templates adminlgs_teams.tpl When I click on the new tab, I get a blank page. Here is my code for the controller. AdminTeamsController.php <?php class AdminTeamsController extends ModuleAdminController { public function __construct() { $this->table = 'teams'; $this->className = 'AdminTeams'; parent :: __construct(); } public function initContent() { parent::initContent(); return $this->display(_PS_ROOT_DIR_.'/modules/lgs_teams/views/templates/admin/lgs_teams.tpl'); } } // END I've tried several things and I can not get the .tpl file to load when clicking the new tab. Any ideas? I put the site into debug mode. No errors display. Thank you for any help. Link to comment Share on other sites More sharing options...
wstar Posted May 18, 2015 Author Share Posted May 18, 2015 Anyone have any ideas? Link to comment Share on other sites More sharing options...
presta.show Posted May 19, 2015 Share Posted May 19, 2015 (edited) Hi, try this in AdminTeamsController: public function createTemplate($tpl_name) { if (file_exists($this->getTemplatePath() . 'lgs_teams.tpl') && $this->viewAccess()) return $this->context->smarty->createTemplate($this->getTemplatePath() . 'lgs_teams.tpl', $this->context->smarty); return parent::createTemplate($tpl_name); } public function getTemplatePath() { return _PS_MODULE_DIR_ . $this->name . '/views/templates/admin/'; } Edited May 19, 2015 by prestashow.eu (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now