In Magento, every element on the page is shown on the basis of layout handle, by which it has been called.
For example: if captcha has been called on the action /contacts
, then the layout handle contacts_index_index
will be able to show captcha.
To call captcha for contact form in the cms page, you would need to write layout update for the cms page.
Update: You need to go to the cms page, click on the Design tab and enter the layout update XML in the Custom Layout Update XML textarea.
<reference name="content">
<block type="core/template" name="contactForm">
<action method="setTemplate">
<template>contactcaptcha/contacts/form.phtml</template>
</action>
<action method="setFormAction">
<form_action>contacts/index/post</form_action>
</action>
<block type="core/text_list" name="form.additional.info">
<block type="captcha/captcha" name="captcha">
<reference name="head">
<action method="addJs">
<file>mage/captcha.js</file>
</action>
</reference>
<action method="setFormId">
<formId>contacts</formId>
</action>
<action method="setImgWidth">
<width>230</width>
</action>
<action method="setImgHeight">
<width>50</width>
</action>
</block>
</block>
</block>
</reference>
Next, click on Content tab and put
in the textarea.
Then click on Save Page button and flush Magento Cache.
Note: Even though the form will start showing captcha on the page, but after submitting the form, it will redirect to the default contacts page.
Note: Every time when you will open the cms page, you need to put
in the textarea before saving the page.
Please let me know if it helped.