Jianov
Jianov

Reputation: 41

Custom Template Prestashop

I am looking for some more detailed tutorials about how to implement new page templates in prestashop without CMS because I saw it is very limited.

My problem is that I need to create 2-3 pages with different templates something like ACF Wordpress where you can add a repeater and create how many sections you want.

How should I do this thing? I found a lot of tutorials but nothing detailed. The worst part is that I am new with Prestashop and I don't know what is the best practice in this CMS, but I know PHP so I can handle, I can't figure what how this functionality should work, until now I think I found 2 methods:

  1. Extends the CMS form but this method seems to be difficult to apply (but if this is the right one I will do).

  2. Create a new module to create pages and assign templates. (At this method I have the following problem: even if I could do all these features, I don't know how should I assign a URL to my page from admin).

Could you please give me some adivces or tell me of one of the above mothods will work? I am already looking for 2 days methods and tutorials.

Thank you!

Upvotes: 0

Views: 215

Answers (1)

Alexander Grosul
Alexander Grosul

Reputation: 1814

The second method is correct and more flexible and powerful. You can create your own module which could have as many new pages with their own templates as you need. Indeed, there is nothing difficult to implement this approach. What about URL's, if you will implement everything correct you would be able to assign any URL you wish from the admin panel within Friendly URL functionality(like it is for all default pages) or if you won't use Friendly URL it gonna look this way your_domain/index.php?fc=module&module=your_module&controller=controller_that_handle_the _page&parameter_1=1&parameter_2=2. Anyway, all links would be generated automatically if you wouldn't use Friendly URL. These articles may help you https://belvg.com/blog/creating-frontcontroller-in-the-module-and-customization-of-displaying-page-in-prestashop.html, https://belvg.com/blog/prestashop-1-7-mvc-part-2-creating-a-controller.html

Upvotes: 1

Related Questions