jobe451
(Daniel Keller)
September 1, 2017, 11:00pm
1
I have a form which will be displayed on many pages. It will reflect registration-requets for what is offered on the page, where the form is positioned.
The receiver of the mail/registration-request should at least know, from what page this request is coming, since the very same form is getting reused. Ideally I would be able to put information from the page-properties to the mail message.
I didn’t find any documentation on how this could be achieved.
paul
(Paul Ehrlich)
September 2, 2017, 9:29am
2
Moin Daniel,
I hope this helps. It was Bastians answer of my similar question.
Ja, aber von dort ist es doch einfach, an den DocumentNode zu kommen.
Das ganze könnte z.B: so aussehen:
prototype(Your.Package:SpecialForm) < prototype(Neos.NodeTypes:Form) {
overrideConfiguration = Neos.Fusion:RawArray {
finishers = Neos.Fusion:RawArray {
# first finisher
0 = Neos.Fusion:RawArray {
# finisher options
options = Neos.Fusion:RawArray {
variables = Neos.Fusion:RawArray {
pageTitle = ${q(documentNode).property('title')}
…
I implemented it as follows:
prototype(Neos.NodeTypes:Form){
overrideConfiguration = Neos.Fusion:RawArray {
finishers = Neos.Fusion:RawArray {
# first finisher
0 = Neos.Fusion:RawArray {
# finisher options
options = Neos.Fusion:RawArray {
variables = Neos.Fusion:RawArray {
pageTitle = ${q(documentNode).property(‘title’)}
datum = ${Date.Format(q(documentNode).property(‘workshopDatum’),‘d.m.Y’)}
zeit = ${q(documentNode).property(‘workshopZeit’)}
preis = ${q(documentNode).property(‘workshopPreis’)}
veranstalter = ${q(documentNode).property(‘workshopVeranstalter’)}
ort = ${q(documentNode).property(‘workshopOrt’)}
}
}
}
}
}
presetName = ‘bootstrap’
}
and in the email.txt file:
{pageTitle}
Datum: {datum}
Zeit: {zeit}
Kosten: {preis}
…
Best wishes,
Paul
jobe451
(Daniel Keller)
September 3, 2017, 11:26am
3
Awesome, thanks a lot for your help. This did the trick for me.
I have now this fusion-definition:
prototype(jobe.drsch:contactForm) < prototype(Neos.NodeTypes:Form) {
presetName = 'drsch'
formIdentifier = 'contactForm'
overrideConfiguration = Neos.Fusion:RawArray {
finishers = Neos.Fusion:RawArray {
#second finisher
1 = Neos.Fusion:RawArray {
# finisher options
options = Neos.Fusion:RawArray {
variables = Neos.Fusion:RawArray {
pageTitle = ${q(documentNode).property('title')}
startDate = ${Date.format(q(documentNode).property('startDate'),'d.m.Y H:i')}
link = Neos.Neos:NodeUri {
absolute = true
node = ${documentNode}
}
}
}
}
}
}
}
This get’s added to the content-definition where I need it:
prototype(jobe.drsch.myPage) < prototype(Neos.Neos:Content) {
...
content {
form = jobe.drsch:contactForm
}
...
}
Finally the form is added to the template simply like that:
{content.form -> f:format.raw()}