0

What is the recommended way to override the contact .phtml template. All I want to do is add HTML tags around the form so I can use bootstrap to give it a nice layout.

As far as I know there is no way to call the contact form in my contact-info page using something like {{block class="..." template="..."}}

So I tried to add the additional HTML code around the form in the .phtml thats being loaded on the contact page. What I've done is creating a form.phtml file in the path below as some answers on SO told me to:

app/design/frontend/VENDOR/THEME/Magento_Contact/view/frontend/templates/form.phtml

Besides that form.phtml the Magento_Contact folder is empty. Am I missing something?

0

2 Answers 2

0

Wrong file place :

app/design/frontend/VENDOR/THEME/Magento_Contact/view/frontend/templates/form.phtml

Should be

app/design/frontend/VENDOR/THEME/Magento_Contact/templates/form.phtml
2
0

I think following thread can help you.

Unable to overwrite Contact Form in Magento 2

In this, sample module is used to achieve it.

1
  • That seems a little bit too much for only changing the form layout. The reason why my override didn't work is because I had the wrong path, see answer. May 8, 2017 at 14:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.