I have created cms page name : contact us identifier: contact-us,

my layout:

<referenceBlock name="contactForm" template="Vendor_Block::form.phtml">
    <block class="Vendor\Module\Block\Fields" template="Vendor_Block::fields.phtml" name="contact.fields" />
    <block class="Magento\Cms\Block\Block" name="cms.contact.us">
            <argument name="block_id" xsi:type="string">contact-us</argument>

I am getting following error on localhost/magento/contact-us

We're sorry, an error has occurred while generating this content.

  • where are you loading these layout instructions?
    – Diana
    Commented Mar 16, 2021 at 14:29
  • To my cms page.
    – zus
    Commented Mar 16, 2021 at 14:43
  • can you enable developer mode and see the logs also? maybe there is a more detailed stack trace
    – Diana
    Commented Mar 16, 2021 at 14:47

1 Answer 1


You can call any custom module in cms page like below.

Please edit your cms page "contact-us" in admin and you can add layout directly from admin like :- https://prnt.sc/10p0oac

Please add like above.

  • I can't able to edit my layout xml section.
    – zus
    Commented Mar 18, 2021 at 11:17
  • Why?Please check error logs for that.
    – ZealousWeb
    Commented Mar 18, 2021 at 11:18

Your Answer

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

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