Bluedge Posted January 19, 2016 Share Posted January 19, 2016 (edited) I have developed a few modules with custom page controller based on this tutorial: http://nemops.com/creating-new-pages-in-prestashop/ Everything works fine but I cannot get the meta Title and Description to display in the HTML. SEO & URL rewrite is active and works fine for regular pages. Help anyone? Here is the custom controller code, also attached the full module <?php class testmoduleAllproductsModuleFrontController extends ModuleFrontController { public function init() { $this->page_name = 'allproducts'; // page_name and body id $this->display_column_left = false; $this->display_column_right = false; parent::init(); } public function initContent() { parent::initContent(); $products_partial = Product::getProducts($this->context->language->id, 0, 5, 'name', 'asc'); $products = Product::getProductsProperties($this->context->language->id, $products_partial); $this->context->smarty->assign(array( 'products' => $products, 'homeSize' => Image::getSize('home_default') )); $this->setTemplate('allproducts.tpl'); } } testmodule.zip Edited January 19, 2016 by Bluedge (see edit history) Link to comment Share on other sites More sharing options...
Bluedge Posted January 20, 2016 Author Share Posted January 20, 2016 Anyone please? Link to comment Share on other sites More sharing options...
Bluedge Posted February 3, 2016 Author Share Posted February 3, 2016 (edited) In case someone else hit the same issue, the solution is pretty simple. The page_name property in the init method of the module must be set properly. If your module is called "bestsellers" and your front controller is called "best" the page_name will be set as follow : 'module-bestsellers-best'. Note : thanks to the Prestashop customer support service for this. public function init() { $this->page_name = 'module-bestsellers-best'; parent::init(); } Edited February 3, 2016 by Bluedge (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