Skip to content
This repository has been archived by the owner on Jun 25, 2021. It is now read-only.

Commit

Permalink
add in ability to embed with CMS Page Contacts us block
Browse files Browse the repository at this point in the history
  • Loading branch information
ProxiBlue committed Apr 5, 2018
1 parent cb32018 commit a7cf9c9
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 4 deletions.
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,15 @@ Note the inclusion of two extra variables in the POST:
json: 1,
gcr: $j("#g-recaptcha-response").val()

###Use in CMS Page

You can Place the Contact Us form within a CMS page using the following Block notation:

<ul>
{{block type="proxiblue_recaptcha/contact" name="contactForm" form_action="/contacts/index/post" template="contacts/form.phtml"}}
</ul>

Remember to add the custom block to your allowed blocks in System->Permissions->Blocks. Use ```proxiblue_recaptcha/contact```

Product Review Captcha
-------------------------
Expand All @@ -218,8 +227,9 @@ Product Review Captcha

place the following line into the form, anywhere between the form elements.

<?php echo $this->getChildHtml('recaptcha'); ?>

<ul>
<?php echo $this->getChildHtml('recaptcha'); ?>
</ul>
Customer Wishlist Sharing Captcha
-------------------------

Expand All @@ -237,7 +247,9 @@ Adding reCaptcha allows you to block this.
place the following line into the form, anywhere within the ```<ul class="form-list">``` element.
a good place will be just before the closing ```</ul>``` tag

<?php echo $this->getChildHtml('recaptcha'); ?>
<ul>
<?php echo $this->getChildHtml('recaptcha'); ?>
</ul>

Entered values will be retained upon incorrect captcha entry

Expand Down
21 changes: 21 additions & 0 deletions app/code/community/ProxiBlue/ReCaptcha/Block/Contact.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

/**
* The reCaptcha Block Used to embed into CMS pages
*
* @category ProxiBlue
* @package ProxiBlue_reCaptcha
* @author Lucas van Staden (sales@proxiblue.com.au)
*/
class ProxiBlue_ReCaptcha_Block_Contact extends Mage_Core_Block_Template {

protected $_template = 'contacts/form.phtml';

protected function _prepareLayout()
{
$captchaBlock = $this->getLayout()
->createBlock('captcha/captcha','recaptcha')->setFormId('user_contact');
$this->setChild('recaptcha',$captchaBlock);
return $this;
}
}
2 changes: 1 addition & 1 deletion app/code/community/ProxiBlue/ReCaptcha/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<config>
<modules>
<ProxiBlue_ReCaptcha>
<version>1.6.0</version>
<version>1.7.0</version>
<depends>
<Mage_Captcha/>
</depends>
Expand Down

0 comments on commit a7cf9c9

Please sign in to comment.