Last active
January 31, 2017 19:14
-
-
Save Sebobo/18b8f2b93ca4c174158f9fa17e5b4d85 to your computer and use it in GitHub Desktop.
Wiki style links in Neos CMS Forms
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>')} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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