sami_c Posted October 8, 2017 Share Posted October 8, 2017 Hi, I wrote a module, it's a page showing items, each item linksto a detail page. I created two controllers : list.php whitch is the main page, and details.php. Each one have its own template. This is the main page URL : http://mysite.com/mymodule/list A click on item #9 opens this : http://mysite.com/mymodule/details?id=9 I'd like to rewrite my urls : I go to admin pannel > Preferences > SEO & URLs, I create a new URL where I find the two pages of my module, it's easy to create a personal URL for the main page (list), but I don't see how to do it to the second page (details) since it requires a parameter, my purpose is to have such URLs : List (main) page : http://mysite.com/supermodule Details page : http://mysite.com/supermodule/details/9 This is how I make links from list to details (in list.tpl) : <a href="{$link->getModuleLink('mymodule', 'details', ['id'=>$item.id], true)|escape:'html'}"> Details </a> Regards Link to comment Share on other sites More sharing options...
razaro Posted October 8, 2017 Share Posted October 8, 2017 Check this older post https://www.prestashop.com/forums/topic/342413-module-routes/ and explore bit more on hookModuleRoutes. Link to comment Share on other sites More sharing options...
sami_c Posted October 12, 2017 Author Share Posted October 12, 2017 Thank you very much I found a bettre post : https://stackoverflow.com/questions/39013727/url-link-for-custom-module-in-prestashop-1-6 It works for ps1.5 too 1 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