- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Like to insert the standard contact form in some block or pag eeditor.
Try to insert this in HTML view
{{block class="Magento\Contact\Block\ContactForm" name="contactForm" template="Magento_Contact::form.phtml"}}
But nothing showed...
Can you help me?
Thanks
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @trevo
Yes , that is correct because Captcha is a separate module with its own block
https://github.com/magento/magento2/blob/2.2-develop/app/code/Magento/Captcha/Block/Captcha.php
The captcha module then specifically observes that pages that it wishes to protect and adds a check in for the correct captcha on that form:
https://github.com/magento/magento2/tree/2.2-develop/app/code/Magento/Captcha/Observer
The event observer for the regular contact form is set up here: https://github.com/magento/magento2/blob/9c14af7a97bcf338662de365d2613c7ca9dbf8c6/app/code/Magento/C...
Hope it helps !
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Insert Contact form in page or block
OK sorry,
the solution is this:
Paste this code not in HTML mode and save,
but in preview mode of block or page...
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Insert Contact form in page or block
Now the problem is that in that page where put this code not show the captcha... and when try to send redirect to contact page and show an error that capcha is not correct.
How can show capcha i all forms that i put in page with this code?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @trevo
Yes , that is correct because Captcha is a separate module with its own block
https://github.com/magento/magento2/blob/2.2-develop/app/code/Magento/Captcha/Block/Captcha.php
The captcha module then specifically observes that pages that it wishes to protect and adds a check in for the correct captcha on that form:
https://github.com/magento/magento2/tree/2.2-develop/app/code/Magento/Captcha/Observer
The event observer for the regular contact form is set up here: https://github.com/magento/magento2/blob/9c14af7a97bcf338662de365d2613c7ca9dbf8c6/app/code/Magento/C...
Hope it helps !