2017-07-02 88 views
0

我想將我的聯繫表單中的magento標準captcha包含到cms頁面中。Magento Captcha在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/

但驗證碼不會在我的形式顯示。

顯然這些解決方案在正常的聯繫表單(聯繫人/索引/索引)上工作,但這似乎是我的聯繫表單的錯誤路徑。

我用核心/模板等其他路徑測試過它,但我找不到正確的方法。

現在我正在尋找解決方案,驗證碼可以在我的聯繫表單上使用。 有沒有人有想法?

回答

0

如果您按照上面的鏈接並在管理端的captcha部分創建模塊和「聯繫我們」選項,然後在cms頁面的Design選項卡中添加以下代碼。

<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> 

讓我知道你是否仍然面臨這個問題。