Skip to main content

Neos CMS

note

Before you can use ALAN Captcha, you need to register your website or web application on our ALAN Captcha Admin Panel to obtain a SiteKey and ApiKey. More information about the ALAN Captcha Admin Panel can be found in the ALAN Captcha Admin Panel documentation.

For Neos CMS, we provide two integrations:

  • Alan.NeosForm: A Neos package that integrates ALAN Captcha into Neos forms.
  • Alan.NeosLogin: A Neos package that integrates ALAN Captcha into the Neos Backend Login.

Alan.NeosForm

Install the package via Composer:

composer require alancaptcha/neos-form

This package integrates ALAN Captcha into Neos forms. It works with the following Neos form types: Neos.Form, Neos.Form.Builder and Neos.Fusion.Form.

Configuration for the different form types is described below.

Neos.Form - Configuration

Just add the new form element to your form definition renderables:

label: 'MyLabel'
identifier: myForm
type: 'Neos.Form:Form'
renderables:
-
type: 'Neos.Form:Page'
identifier: page-one
renderables:
-
type: 'Alan.NeosForm:Captcha'
identifier: captcha
label: 'Alan Captcha'
properties:
apiKey: 'API_KEY'
siteKey: 'SITE_KEY'
monitorTag: 'MONITOR_TAG (optional)'
unverifiedtext: '<<Unverified>>'
verifiedtext: '<<Verified>>'
retrytext: '<<Retry>>'
workingtext: '<<Working...>>'
starttext: '<<Start>>'
finishers:
-
<Your finishers here>

...text settings are optional and can be used to customize the text of the captcha element.

Neos.Form.Builder - Configuration

Add the AlanCaptcha form element to your form:

AlanCaptcha Form Element

Configure the element with your ALAN Captcha ApiKey and SiteKey.

Neos.Fusion.Form - Configuration

Add a FieldContainer with the Alan.NeosForm:FusionForm.Captcha element to your form:

<Neos.Fusion.Form:FieldContainer field.name="captcha">
<Alan.NeosForm:FusionForm.Captcha siteKey="SITE_KEY" />
</Neos.Fusion.Form:FieldContainer>

Set the field name based on your needs, but make sure to use the same field name in the schema (see below).

The following options are available:

  • siteKey (required): The AlanCaptcha Site Key.
  • monitorTag (optional): The AlanCaptcha Monitor Tag to use.
  • lang.unverifiedtext (optional)
  • lang.verifiedtext (optional)
  • lang.retrytext (optional)
  • lang.workingtext (optional)
  • lang.starttext (optional)

Then, add the field to the schema and configure the Validator:

captcha = ${Form.Schema.string().validator('Alan.NeosForm:IsValid', {apiKey: 'API_KEY', errorMessage: 'The Alan Captcha check failed. Try submitting the form again.'})}

Make sure that the key (e.g. captcha) matches the key in the FieldContainer (see above).

The following options are available:

  • apiKey (required): The AlanCaptcha Api Key.
  • errorMessage: Use this to override the error message in case of a failed captcha check.

Alan.NeosLogin

Install the package via Composer:

composer require alancaptcha/neos-login

This package integrates ALAN Captcha into the Neos Backend Login. It will automatically display the captcha on the login page, when configured correctly.

If the configuration is not set up correctly, the login page will still work, but the captcha will not be displayed and the login will not be protected by ALAN Captcha.

Configuration

Add the following configuration to your Settings.yaml:

Alan:
NeosLogin:
active: true
apiKey: 'API_KEY'
siteKey: 'SITE_KEY'
monitorTag: 'MONITOR_TAG (optional - default general)'
lang:
unverifiedtext: 'Unverified'
verifiedtext: 'Verified'
retrytext: 'Retry'
workingtext: 'Working...'
starttext: 'Start'

lang settings are optional and can be used to customize the text of the captcha element.