1

I have created a block which contains my company name, address, telephone etc. How can I add this block to my contact page http://www.extenderstore.com.au/contact/ ? I would like it located under the contact form.

1

Assuming you are referring to a cms static block, it can be added with a quick layout update.

app/design/{{Vendor}}/{{Theme}}/Magento_Contact/layout/contact_index_index.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="content">
            <block class="Magento\Cms\Block\Block" name="contact-store-info" before="contactForm">
                <arguments>
                    <argument name="block_id" xsi:type="string">{{block_identifier}}</argument>
                </arguments>
            </block>
        </referenceContainer>
    </body>
</page>
  • It appears on the top. How can I position it under the contact form? – bondimedical Sep 27 '17 at 3:58
  • 1
    change <block class="Magento\Cms\Block\Block" name="contact-store-info" before="contactForm"> to <block class="Magento\Cms\Block\Block" name="contact-store-info" after="contactForm"> – Pmclain Sep 27 '17 at 4:03

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.