Jump to content

Use contact-form in CMS page


Recommended Posts

Hello, I have a problem. How can I call a contact-form function and have it on any custom CMS page I created? The page is created via backend and it uses cms.tpl template. Now I need to have contact-form.tpl inside it. I did an override of both CmsController.php and ContactFormController.php, but I don't know how can I call contact form from my CmsController.php.

 

If you need more info - feel free to ask.

 

I tried https://www.prestashop.com/forums/topic/430454-tutorial-ps-16-adding-cms-content-to-the-contact-page/ this tutorial, but the function from ContactFormController.php doesn't get called at all if I use only CMS custom page. Any ideas?

Link to comment
Share on other sites

  • 1 year later...

I think the idea would be to create a custom hook in your Contact form module and perform a hook execution cms.tpl but you would need to control hook execution according to cms id so that contact form does not get displayed on each cms page.

Apart from that you could also create a new front controller for Contact form module then do anything you need. No need to perform any changes in the cms templates and php files. This would be the best option.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...