Skip to content

Instantly share code, notes, and snippets.

@Sebobo
Last active January 31, 2017 19:14
Show Gist options
  • Save Sebobo/18b8f2b93ca4c174158f9fa17e5b4d85 to your computer and use it in GitHub Desktop.
Save Sebobo/18b8f2b93ca4c174158f9fa17e5b4d85 to your computer and use it in GitHub Desktop.
Wiki style links in Neos CMS Forms
prototype(Neos.NodeTypes:Form) {
@context {
privacyLink = Neos.Neos:NodeUri {
node = ${q(site).property('privacyNode')}
}
}
@process {
replacePrivacyLink = ${String.pregReplace(value, '/\[\[privacyLink\|(.*)\]\]/', '<a href="' + privacyLink + '" title="$1" target="_blank">$1</a>')}
}
}
type: 'Neos.Form:Form'
identifier: 'MyForm'
label: 'My form'
renderingOptions:
submitButtonLabel: 'Submit'
renderables:
-
type: 'Neos.Form:Page'
identifier: 'page-one'
label: 'My form'
renderables:
-
type: 'Neos.Form:Checkbox'
identifier: 'I accept the terms and conditions'
label: 'I accept the [[privacyLink|Terms and conditions]]'
validators:
- identifier: 'Neos.Flow:NotEmpty'
properties:
required: true
finishers:
-
identifier: 'Neos.Form:Confirmation'
options:
message: 'Your request has been submitted!'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment