我想包括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/
但验证码不会显示在我的表单中。
显然,这些解决方案确实适用于普通的联系人表单(联系人/索引/索引),但对于我的联系人表单,这似乎是错误的路径。
我测试了一些其他的路径,比如core/template,但是我找不到正确的方法。
现在我正在寻找一个解决方案,验证码将在我的联系人表单上工作。有谁有主意吗?
发布于 2017-07-03 14:17:18
如果您遵循上述链接,并创建模块和“联系我们”选项在验证码部分在管理方面,然后添加以下代码在设计选项卡在您的内容管理系统页面。
<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>如果你仍然面临这个问题,请让我知道。
发布于 2017-07-03 19:25:51
https://stackoverflow.com/questions/44875229
复制相似问题