1

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.

2 Answers 2

1

If this page is added via the cms section then what you could do is use the design tab in the admin section to add the layout xml that you need for your page. Then in this way you should be able to add all the items that you need.

0

follow these thread it will help you

http://www.magentocommerce.com/boards/viewthread/298363/

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.