0

I use this layout but now Reload captcha doesn't show up. Any idea?

Layout:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <title>Contact Us</title>
    </head>
    <body>
        <referenceBlock name="breadcrumbs">
            <action method="addCrumb">
                <argument name="crumbName" xsi:type="string">Home</argument>
                <argument name="crumbInfo" xsi:type="array">
                    <item name="title" xsi:type="string">Home</item>
                    <item name="label" xsi:type="string">Home</item>
                    <item name="link" xsi:type="string">{{baseUrl}}</item>
                </argument>
            </action>
            <action method="addCrumb">
                <argument name="crumbName" xsi:type="string">Contact Us</argument>
                <argument name="crumbInfo" xsi:type="array">
                    <item name="title" xsi:type="string">Contact Us</item>
                    <item name="label" xsi:type="string">Contact Us</item>
                </argument>
            </action>
        </referenceBlock>
        <referenceContainer name="content">
            <referenceContainer name="columns.top">
                <referenceBlock name="page.main.title" remove="true"/>
            </referenceContainer>
            <block class="Magento\Contact\Block\ContactForm" name="contactForm" template="Magento_Contact::form.phtml">
                <container name="form.additional.info" label="Form Additional Info"/>
            </block>
        </referenceContainer>
    </body>
</page>

Template:

<form class="form contact"
      action="<?php /* @escapeNotVerified */ echo $block->getFormAction(); ?>"
      id="contact-form"
      method="post"
      data-hasrequired="<?php /* @escapeNotVerified */ echo __('* Required Fields') ?>"
      data-mage-init='{"validation":{}}'>
    <fieldset class="fieldset">
        <div class="contact-content row">
            <div class="col-lg-12">
                <?php echo $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('block_map_contacts')->toHtml();?>
            </div>
            <div class="content">
                <div class="form-content">
                    <div class="col-xs-12 col-sm-8 col-md-8">
                        <div class="custom-title">
                            <h3 class="title"><?php echo __('Drop us a message') ?></h3>
                            <p class="subcribe"><?php echo __('Please use the below contact form to send us a message. We aim to get back to you within 24 hours. It could be slightly longer in peak times. If your query is urgent, we do recommend you call us during our office hours to escalate your query immediately.<p> For order related queries, please include your order reference ID and shipment post code.') ?></p>
                        </div>
                        <div class="field name required box">
                            <label class="label" for="name"><span><?php /* @escapeNotVerified */ echo __('Name') ?></span></label>
                            <div class="control">
                                <input name="name" id="name" title="<?php /* @escapeNotVerified */ echo __('Name') ?>" value="<?php echo $block->escapeHtml($this->helper('Magento\Contact\Helper\Data')->getUserName()) ?>" class="input-text" type="text" data-validate="{required:true}"/>
                            </div>
                        </div>
                        <div class="field email required box">
                            <label class="label" for="email"><span><?php /* @escapeNotVerified */ echo __('Email') ?></span></label>
                            <div class="control">
                                <input name="email" id="email" title="<?php /* @escapeNotVerified */ echo __('Email') ?>" value="<?php echo $block->escapeHtml($this->helper('Magento\Contact\Helper\Data')->getUserEmail()) ?>" class="input-text" type="email" data-validate="{required:true, 'validate-email':true}"/>
                            </div>
                        </div>
                        <div class="field telephone box">
                            <label class="label" for="telephone"><span><?php /* @escapeNotVerified */ echo __('Phone Number') ?></span></label>
                            <div class="control">
                                <input name="telephone" id="telephone" title="<?php /* @escapeNotVerified */ echo __('Phone Number') ?>" value="" class="input-text" type="text" />
                            </div>
                        </div>
                        <div class="field comment required box">
                            <label class="label" for="comment"><span><?php /* @escapeNotVerified */ echo __('Your Message') ?></span></label>
                            <div class="control">
                                <textarea name="comment" id="comment" title="<?php /* @escapeNotVerified */ echo __('Your Message') ?>" class="input-text" cols="5" rows="3" data-validate="{required:true}"></textarea>
                            </div>
                        </div>
                        <div class="actions-toolbar">
                            <div class="primary">
                                <input type="hidden" name="hideit" id="hideit" value="" />
                                <button type="submit" title="<?php /* @escapeNotVerified */ echo __('Send') ?>" class="action submit primary">
                                    <span><?php /* @escapeNotVerified */ echo __('Send') ?></span>
                                </button>
                            </div>
                        </div>
                    </div>
                    <div class="col-xs-12 col-sm-4 col-md-4">
                        <?php echo $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('block_text_contacts')->toHtml();?>
                    </div>
                    <?php echo $block->getChildHtml('form.additional.info'); ?>
                </div>
            </div>
        </div>
    </fieldset>

</form>
<style>
.breadcrumbs li.Home:before{display: none;}
.contact-content .actions-toolbar .primary{margin-bottom: 20px;}
.contact-content .actions-toolbar .primary .primary{margin: 0;padding: 0;height: auto;width: 100%;}
</style>
0

I have fixed it by change layout to:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <title>Contact Us</title>
    </head>
    <body>
        <referenceContainer name="content">
            <block class="Magento\Contact\Block\ContactForm" name="contactForm" template="Magento_Contact::form.phtml">
                <container name="form.additional.info" label="Form Additional Info"/>
            </block>
        </referenceContainer>
    </body>
</page>
| improve this answer | |

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.