Genie Posted July 16, 2014 Share Posted July 16, 2014 I am developting a custom module amd want to display a page of my module in fromtend. So i have created a file display.php and assigned the smarty variables with to a tpl file called display.tpl file. Now it is showing the view when the address bar url is http://localhost/modules/mymodule/display.php. But i want to rewrite the url suppose as http://localhost/modules/mymodule/display/ Which will show the same view as it is showing with http://localhost/modules/mymodule/display.php. Need help. Please tell me how to do this with .htaccess file or something else and how. Link to comment Share on other sites More sharing options...
El Patron Posted July 16, 2014 Share Posted July 16, 2014 I think you can do this from back office back office-->preferences-->seo & urls add a new page 1 Link to comment Share on other sites More sharing options...
Genie Posted July 16, 2014 Author Share Posted July 16, 2014 Hello El Patron I tried this what you told. But I can't find my-module's display page in the drop down list to be selected. another question is I don't want to do this with backend. I just want whenever my module is installed it will come with that url re-written feature. Is this possible? Link to comment Share on other sites More sharing options...
El Patron Posted July 16, 2014 Share Posted July 16, 2014 I think you might look at existing module (see the drop down in seo & urls) to see how those modules register their page name. Then I think it might be possible to add (using module) the module page to the existing pages like AdminMeta&addmeta. Link to comment Share on other sites More sharing options...
vekia Posted July 16, 2014 Share Posted July 16, 2014 just create module front controller <?php class mymoduledisplayModuleFrontController extends ModuleFrontController { public function initContent() { parent::initContent(); $this->setTemplate('display.tpl'); } } like it is described here http://doc.prestashop.com/display/PS15/Creating+a+PrestaShop+module#CreatingaPrestaShopmodule-Embeddingatemplateinthetheme 1 Link to comment Share on other sites More sharing options...
misthero Posted July 16, 2014 Share Posted July 16, 2014 (edited) Hello El Patron I tried this what you told. But I can't find my-module's display page in the drop down list to be selected. another question is I don't want to do this with backend. I just want whenever my module is installed it will come with that url re-written feature. Is this possible? did you tried something like this? $urlLink = new Link; $myCleanUrl = $urlLink->getModuleLink('modulename', 'prettylink'); Edited July 16, 2014 by misthero (see edit history) 1 Link to comment Share on other sites More sharing options...
vekia Posted July 16, 2014 Share Posted July 16, 2014 without controller this link will not work :-) but of course, it's correct way to create links Link to comment Share on other sites More sharing options...
misthero Posted July 16, 2014 Share Posted July 16, 2014 no controller no party, I supposed "display.php" was his controller but I'm obviously wrong 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