-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #97 from neos/feature/addContactFormBasedOnFusionF…
…orms FEATURE: Add ContactForm NodeType based on the Neos.Fusion.Form package This change adds a very basic ContactForm NodeType based on Neos.Fusion.Forms. https://github.com/neos/fusion-form The content still mentions the fusion.form framework alongside neos.fusion.form but the content o the form page is now a fusion form with inspector settings.
- Loading branch information
Showing
13 changed files
with
240 additions
and
159 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
## | ||
# A very simple "contactForm" nodetype based on the Neos.Fusion.Form package | ||
# | ||
'Neos.Demo:Content.ContactForm': | ||
superTypes: | ||
'Neos.Neos:Content': true | ||
'Neos.Demo:Constraint.Content.Column': true | ||
ui: | ||
label: i18n | ||
icon: 'icon-envelope' | ||
inspector: | ||
groups: | ||
email: | ||
label: i18n | ||
icon: envelope | ||
tab: default | ||
redirect: | ||
label: i18n | ||
icon: share | ||
tab: default | ||
message: | ||
label: i18n | ||
icon: comment | ||
tab: default | ||
properties: | ||
subject: | ||
type: string | ||
defaultValue: '' | ||
ui: | ||
label: i18n | ||
inspector: | ||
group: email | ||
recipientName: | ||
type: string | ||
defaultValue: '' | ||
ui: | ||
label: i18n | ||
inspector: | ||
group: email | ||
recipientAddress: | ||
type: string | ||
defaultValue: '' | ||
ui: | ||
label: i18n | ||
inspector: | ||
group: email | ||
senderName: | ||
type: string | ||
defaultValue: '' | ||
ui: | ||
label: i18n | ||
inspector: | ||
group: email | ||
senderAddress: | ||
type: string | ||
defaultValue: '' | ||
ui: | ||
label: i18n | ||
inspector: | ||
group: email | ||
redirect: | ||
type: reference | ||
defaultValue: null | ||
ui: | ||
label: i18n | ||
inspector: | ||
group: redirect | ||
editorOptions: | ||
nodeTyps: ['Neos.Neos:Document'] | ||
message: | ||
type: string | ||
defaultValue: '' | ||
ui: | ||
label: i18n | ||
inspector: | ||
group: message | ||
editor: 'Neos.Neos/Inspector/Editors/TextAreaEditor' | ||
editorOptions: | ||
rows: 7 |
This file was deleted.
Oops, something went wrong.
This file contains 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
Binary file added
BIN
+22.2 KB
Resources/Private/Content/Resources/4a87504ef49f5c5d1aaa7ce7ff47a124fd421dec
Binary file not shown.
Binary file added
BIN
+88.1 KB
Resources/Private/Content/Resources/d798dbdb80df7f24e94455c4961b7a3d231ccce0
Binary file not shown.
Binary file added
BIN
+27.4 KB
Resources/Private/Content/Resources/f1769206023d2b0d9ab00475867da01c44c4a74e
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
## | ||
# "ContactForm" element | ||
# | ||
prototype(Neos.Demo:Content.ContactForm) < prototype(Neos.Neos:ContentComponent) { | ||
|
||
renderer = Neos.Fusion.Form:Runtime.RuntimeForm { | ||
namespace = 'contact' | ||
process { | ||
content = afx` | ||
<fieldset> | ||
<legend>Contact</legend> | ||
<Neos.Fusion.Form:FieldContainer label="Name" field.name="name" attributes.class="form-group clearfix"> | ||
<div class="input"> | ||
<Neos.Fusion.Form:Input attributes.class="form-control" /> | ||
</div> | ||
</Neos.Fusion.Form:FieldContainer> | ||
<Neos.Fusion.Form:FieldContainer label="Email" field.name="email" attributes.class="form-group clearfix"> | ||
<div class="input"> | ||
<Neos.Fusion.Form:Input attributes.class="form-control" /> | ||
</div> | ||
</Neos.Fusion.Form:FieldContainer> | ||
<Neos.Fusion.Form:FieldContainer label="Message" field.name="message" attributes.class="form-group clearfix"> | ||
<div class="input"> | ||
<Neos.Fusion.Form:Textarea attributes.class="form-control" /> | ||
</div> | ||
</Neos.Fusion.Form:FieldContainer> | ||
</fieldset> | ||
` | ||
|
||
footer = afx` | ||
<button type="submit" class="btn btn-primary">Submit</button> | ||
` | ||
|
||
schema { | ||
name = ${Form.Schema.string().isRequired()} | ||
email = ${Form.Schema.string().isRequired().validator('EmailAddress')} | ||
message = ${Form.Schema.string().isRequired()} | ||
} | ||
} | ||
|
||
action { | ||
message { | ||
type = 'Neos.Fusion.Form.Runtime:Message' | ||
options.message = ${q(node).property('message')} | ||
} | ||
|
||
email { | ||
@if.has = ${q(node).property('subject') && q(node).property('recipientAddress') && q(node).property('senderAddress')} | ||
type = 'Neos.Fusion.Form.Runtime:Email' | ||
options { | ||
recipientName = ${q(node).property('recipientName')} | ||
recipientAddress = ${q(node).property('recipientAddress')} | ||
senderName = ${q(node).property('senderName')} | ||
senderAddress = ${q(node).property('senderAddress')} | ||
replyToAddress = ${data.email} | ||
subject = ${q(node).property('subject')} | ||
html = afx` | ||
<p>Message from {data.name}</p> | ||
<p>{data.message}</p> | ||
` | ||
} | ||
} | ||
|
||
redirect { | ||
@if.has = ${q(node).property('redirect')} | ||
type = 'Neos.Fusion.Form.Runtime:Redirect' | ||
options.uri = Neos.Neos:NodeUri { | ||
node = ${q(node).property('redirect')} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
40 changes: 40 additions & 0 deletions
40
Resources/Private/Translations/en/NodeTypes/Content/ContactForm.xlf
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2"> | ||
<file original="" product-name="Neos.Demo" source-language="en" datatype="plaintext"> | ||
<body> | ||
<trans-unit id="ui.label" xml:space="preserve"> | ||
<source>Contact Form</source> | ||
</trans-unit> | ||
<trans-unit id="groups.message" xml:space="preserve"> | ||
<source>Message</source> | ||
</trans-unit> | ||
<trans-unit id="groups.email" xml:space="preserve"> | ||
<source>EMail</source> | ||
</trans-unit> | ||
<trans-unit id="groups.redirect" xml:space="preserve"> | ||
<source>Redirect</source> | ||
</trans-unit> | ||
<trans-unit id="properties.message" xml:space="preserve"> | ||
<source>Message after submit</source> | ||
</trans-unit> | ||
<trans-unit id="properties.redirect" xml:space="preserve"> | ||
<source>Redirect after submit</source> | ||
</trans-unit> | ||
<trans-unit id="properties.recipientName" xml:space="preserve"> | ||
<source>Recipient name</source> | ||
</trans-unit> | ||
<trans-unit id="properties.recipientAddress" xml:space="preserve"> | ||
<source>Recipient email address</source> | ||
</trans-unit> | ||
<trans-unit id="properties.senderName" xml:space="preserve"> | ||
<source>Sender name</source> | ||
</trans-unit> | ||
<trans-unit id="properties.senderAddress" xml:space="preserve"> | ||
<source>Sender email address</source> | ||
</trans-unit> | ||
<trans-unit id="properties.subject" xml:space="preserve"> | ||
<source>Subject</source> | ||
</trans-unit> | ||
</body> | ||
</file> | ||
</xliff> |
This file contains 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