I'am trying to add Magento Captcha in my custom contact form and it's not working...
I added into contacts.xml the following :
<block type="core/template" name="contactForm" template="contacts/form.phtml">
<block type="captcha/captcha" name="captcha">
<reference name="head">
<action method="addJs"><file>mage/captcha.js</file></action>
</reference>
<action method="setFormId"><formId>contact_form</formId></action>
<action method="setImgWidth"><width>230</width></action>
<action method="setImgHeight"><width>50</width></action>
</block>
</block>
In my contact.phtml I added :
<?php echo $this->getChildHtml('captcha'); ?>
I think the problem is because my template file is called in a static block like this and the child captcha isn't known.
{{block type="core/template" name="contactForm" form_action="/contacts/index/post" template="contacts/form.phtml"}}
So the getChildHtml is null like it doesn't exist.