I am trying to create a custom page with xml and phtml and I do not know the right way to do that.


These are two different files in Magento 2.

There are configuration files with extension .xml and template files with extension .phtml

You can see some of configuration files at Vendor/Module/etc/ and template files at Vendor/Module/view/frontend/template

Here is an example how to create an xml file


Example for template file


Good Luck

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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