cms页面上的Magento 2 Magetcha模块显示
我已经在我的Magento 2网上商店上安装了该模块 该模块在默认联系人表单上运行良好,但在自定义cms页面上不会呈现reCAPTCHA 这是我在自定义cms页面上显示联系人表单的方式:cms页面上的Magento 2 Magetcha模块显示,magento,magento2,Magento,Magento2,我已经在我的Magento 2网上商店上安装了该模块 该模块在默认联系人表单上运行良好,但在自定义cms页面上不会呈现reCAPTCHA 这是我在自定义cms页面上显示联系人表单的方式: {{block class=“Magento\Contact\block\ContactForm”name=“ContactForm”template=“Magento\u Contact::form.phtml”} 我试图将模块contact_index_index的布局部分的代码片段添加到cms页面布局更新
{{block class=“Magento\Contact\block\ContactForm”name=“ContactForm”template=“Magento\u Contact::form.phtml”}
我试图将模块contact_index_index的布局部分的代码片段添加到cms页面布局更新XML中
<referenceContainer name="form.additional.info">
<block class="MSP\ReCaptcha\Block\Frontend\ReCaptcha" name="msp-recaptcha" after="-" template="MSP_ReCaptcha::msp_recaptcha.phtml">
<arguments>
<argument name="jsLayout" xsi:type="array">
<item name="components" xsi:type="array">
<item name="msp-recaptcha" xsi:type="array">
<item name="component" xsi:type="string">MSP_ReCaptcha/js/reCaptcha</item>
<item name="zone" xsi:type="string">contact</item>
</item>
</item>
</argument>
</arguments>
</block>
</referenceContainer>
MSP_ReCaptcha/js/ReCaptcha
接触
这也无助于尝试在自定义cms页面上呈现reCAPTCHA
有人能帮我解决这个问题吗?通过下面的代码,我可以在CMS页面中添加Contact Us表单以及表单上的MSP reCaptcha,在管理>内容>页面>[CMS页面]>添加/编辑>设计>版面更新XML中添加下面的代码:
<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>
<referenceContainer name="form.additional.info">
<block class="MSP\ReCaptcha\Block\Frontend\ReCaptcha" name="msp-recaptcha" after="-"
template="MSP_ReCaptcha::msp_recaptcha.phtml">
<arguments>
<argument name="jsLayout" xsi:type="array">
<item name="components" xsi:type="array">
<item name="msp-recaptcha" xsi:type="array">
<item name="component" xsi:type="string">MSP_ReCaptcha/js/reCaptcha</item>
<item name="zone" xsi:type="string">contact</item>
</item>
</item>
</argument>
</arguments>
</block>
</referenceContainer>
MSP_ReCaptcha/js/ReCaptcha
接触
尝试在cms页面布局更新中使用referenceContainer name=“content”XML@faizanbeg谢谢你的回复!这样做确实让reCAPTCHA出现了,现在我只需要把它放在表单中。我还试着用“联系方式”作为参考。这并没有帮助,但reCAPTCHA仍然可见。您还有其他想法吗?您必须将recapcha指定为联系人表单的子级,然后它将显示在联系人表单中