banditbirds Posted January 6, 2017 Share Posted January 6, 2017 Hi all, I would like to create a global smarty variable, and use the value of the variable on every page of my website. I assume I need to user an override to one of the Controllers? But can't get this to work in 1.7 I will then use this global variable to determine which content to display on my pages. Any help appreciated. Thanks! Simon Link to comment Share on other sites More sharing options...
banditbirds Posted January 7, 2017 Author Share Posted January 7, 2017 (edited) I have: \override\controllers\front\FrontController.php class FrontController extends FrontControllerCore { public function initHeader() { self::$smarty->assign('is_night', 0); return parent::initHeader(); } } I've also tried with a module: \modules\se_daynight\se_daynight.php public function hookHeader($params) { global $smarty; $this->smarty->assign('is_night', 0); } Edited January 7, 2017 by banditbirds (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