sackling Posted April 4, 2014 Share Posted April 4, 2014 I decided to take a look at how things work in the basic theme. and I decided to checkout the homeslider to start. I am looking at homeslider.tpl and the first thing I see is that it checks to see if the variable$ homeslider_slides isset. That's fine and all. but I can't seem to find the variable homeslider_slides in any php files. Or in any of the other files for that matter. Where is it defined? I then decided to just checkout index.tpl and I see $HOOK_HOME_TAB_CONTENT Another variable I can't find defined anywhere. So clearly I am the fool here. But I still don't understand smarty nearly at all. Thanks for some help! Link to comment Share on other sites More sharing options...
Enrique Gómez Posted April 5, 2014 Share Posted April 5, 2014 I suggest you to use an IDE like Eclipse so you have all the prestashop shop in one project That way you can search inside the entire project, and filter by file types..etc So for example searching I've found that modules\homeslider\homeslider.php in line 644 (ps1562) $this->smarty->assign('homeslider_slides', $slides); $this->smarty->assign('homeslider', $slider); In index.tpl I have {$HOOK_HOME} which is fulfilled in controllers\front\IndexController.php class IndexControllerCore extends FrontController { public $php_self = 'index'; /** * Assign template vars related to page content * @see FrontController::initContent() */ public function initContent() { parent::initContent(); $this->context->smarty->assign('HOOK_HOME', Hook::exec('displayHome')); $this->setTemplate(_PS_THEME_DIR_.'index.tpl'); } } Link to comment Share on other sites More sharing options...
sackling Posted April 5, 2014 Author Share Posted April 5, 2014 Ah ok. I need to read up more on smarty as well. I am using netbeans as the ide. I was searching for $homeslider_slides which clearly is not how variables are assigned. Thanks 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