【问题标题】:Magento Captcha in contact form on CMS pageMagento Captcha 在 CMS 页面上的联系表格中
【发布时间】:2017-07-02 21:09:15
【问题描述】:

我想将我的联系表单中的 magento 标准验证码包含到 cms 页面中。

表单将包含在页面的 cms-content-field 中。

{{block type="core/template" name="contactForm" form_action="/contacts/index/post" template="contacts/form.phtml"}}

这很好用。没问题。

有很多教程可以将标准验证码包含到标准联系表单中。 https://janakbhimani.wordpress.com/2013/09/14/how-to-add-captcha-in-contact-us-form-in-magento-1-7-0-2/ http://www.phpfunctionoftheday.com/magento-captcha-contact-form/

但验证码不会显示在我的表单中。

显然,这些解决方案确实适用于正常的联系表单(联系人/索引/索引),但这似乎是我的联系表单的错误路径。

我用核心/模板等其他路径对其进行了测试,但我找不到正确的方法。

现在我正在寻找一种解决方案,让验证码可以在我的联系表单上运行。 有人有想法吗?

【问题讨论】:

    标签: php magento magento-1.9 captcha contact-form


    【解决方案1】:

    如果您按照上面的链接并在管理端的验证码部分创建模块和“联系我们”选项,然后在您的 cms 页面的设计选项卡中添加以下代码。

    <reference name="content">
                <block type="captcha/captcha" name="captcha">
                    <reference name="head">
                        <action method="addJs"><file>mage/captcha.js</file></action>
                    </reference>
                    <action method="setFormId"><formId>contact_page_captcha</formId></action>
                    <action method="setImgWidth"><width>230</width></action>
                    <action method="setImgHeight"><width>50</width></action>
                </block>
    </reference>
    

    如果您仍然遇到此问题,请告诉我。

    【讨论】:

      【解决方案2】:

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2023-03-07
        相关资源
        最近更新 更多