ramoneces Posted September 9, 2018 Share Posted September 9, 2018 (edited) Hello all, I'm new to PrestaShop development. I'm developing a module which creates a custom form that is shown in the front office. Currently the url for this form is static: http://myweb/module/mymodule/mycontroller I need the admin to be able to configure the URL of that page. I thought of two ways of doing this: Letting the admin select an existing page, and then somehow make my module override that page's content with my controller. Letting the admin to specify a url for my controller. I prefer the first solution so I can take advantage of all PrestaShop page-related stuff, like meta data storage and localization. Do you know how can I achieve 1 or 2? could you point me to some example or piece of documentation? Thank you in advance! Edited September 9, 2018 by ramoneces (see edit history) Link to comment Share on other sites More sharing options...
Kogkalidis Posted September 10, 2018 Share Posted September 10, 2018 You mean for example to assing product with ID 1 and instead of product page your module tpl to be displayed?` I actually cannot understand what you want to achieve. Link to comment Share on other sites More sharing options...
ramoneces Posted September 10, 2018 Author Share Posted September 10, 2018 8 hours ago, tapanda.gr said: You mean for example to assing product with ID 1 and instead of product page your module tpl to be displayed?` I actually cannot understand what you want to achieve. Thank you for replying, i'll try to make myself clear: My module shows in the front-office an advanced search page consisting of a form with filters and a table of products that match those criteria. Now I need the shop manager to be able to dynamically specify a URL for that search page, like: www.myshop.com/super-cool-search-page And I thought an easy way of doing that could be: The shop manager create an ordinary PrestaShop page with localized property values and all: Meta title: Cool search URL: www.myshop.com/super-cool-search-page Meta keywords: cool, search, products Etc. The shop manager choses that page in my module's configuration, using a selector. When some visitor goes to www.myshop.com/super-cool-search-page, they can use my module's outstanding search form. The thing I don't know how to do is making my module override (or append to) some page's content. Namely, showing module content in an specific page created and chosen by the shop manager. Link to comment Share on other sites More sharing options...
Kogkalidis Posted September 10, 2018 Share Posted September 10, 2018 I believe you come from wordpress. Because these guys work a lot with "pages". The workflow in PrestaShop, though, is a bit different. Usually you make friendly URL mechanism for your module and the only thing you have to do is update the url of your front controller to whatever you like. Then you access the page as user copy the url and use it as you wish. Link to comment Share on other sites More sharing options...
ramoneces Posted September 11, 2018 Author Share Posted September 11, 2018 Thank you tapanda! Actualy, I come mainly from Drupal but you are right. I wasn't aware of the Traffic and SEO settings, which serves my purpose perfectly, allowing the shop administrator to choose one or several URLs for the module's front 'pages'. 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