ilclaudio Posted October 24, 2016 Share Posted October 24, 2016 Hi all,some times I have some difficulties to uderstand which is the controller that lies beneath a tpl page.How can print the name of its controller in a tpl?Thank you very muchcld Link to comment Share on other sites More sharing options...
razaro Posted October 24, 2016 Share Posted October 24, 2016 Well in most cases you will see in body id and class page name that indicate what constoller it is used on page. Also check this free module https://www.prestashop.com/forums/topic/468925-what-is-this-module-what-is-this-hook-css-js-tpl/ 1 Link to comment Share on other sites More sharing options...
ilclaudio Posted October 24, 2016 Author Share Posted October 24, 2016 Thank you. For example I'm looking for the controller beneath the product-list.tpl page. The $products variable used in it where does is produced? cld Link to comment Share on other sites More sharing options...
NemoPS Posted October 24, 2016 Share Posted October 24, 2016 Try with $page_name. It's usually about guessing anyway. Download your presta folder, do a global search for the template name, or if you want to be more specific $this->setTemplate('templatename.tpl);This should bring up the controller Link to comment Share on other sites More sharing options...
ilclaudio Posted October 24, 2016 Author Share Posted October 24, 2016 Thank you. For example I'm looking for the controller beneath the product-list.tpl page. The $products variable used in it where does is produced? cld In this case the controller is Categorycontroller.php Link to comment Share on other sites More sharing options...
razaro Posted October 24, 2016 Share Posted October 24, 2016 Well product-list.tpl is bit specific. Depending where it used, $products variable is passed from different controllers. On homepage for example each tab calls modules controller as $products are passed in their tpl (blocknew, bestsellers, homefeatured. On other pages apropriate controller is used, for category page CategoryController, for new products NewProductsController and so on. They are in controllers/front. But what are you trying to do exactly ? Link to comment Share on other sites More sharing options...
NemoPS Posted October 24, 2016 Share Posted October 24, 2016 product-list has no controller. The one you are looking for in that case is for category.tpl, which is CategoryController.phpIn any case, use global searches, just the template name will tell you which file is including it 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