Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] EXT:form - Allow predefined forms
This patchset enables the integration of predefined forms. An integrator can define forms - for example within the site package - using plugin.tx_form.predefinedForms. An editor can add a new mailform content element to a page and choose a form from the list of predefined elements. Example integration: plugin.tx_form.predefinedForms.someUniqueName = FORM plugin.tx_form.predefinedForms.someUniqueName { ... } Resolves: #72309 Releases: master Change-Id: I79def3cc00812bd5e5006b5226216064cc1b7ac7 Reviewed-on: https://review.typo3.org/45357 Reviewed-by: Benni Mack <benni@typo3.org> Tested-by: Benni Mack <benni@typo3.org> Reviewed-by: Oliver Hader <oliver.hader@typo3.org> Tested-by: Oliver Hader <oliver.hader@typo3.org>
- Loading branch information
1 parent
72d6c6e
commit d4d6b5b
Showing
5 changed files
with
206 additions
and
26 deletions.
There are no files selected for viewing
108 changes: 108 additions & 0 deletions
108
...on/Changelog/master/Feature-72309-EXTform-AllowIntegrationOfPredefinedForms.rst
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,108 @@ | ||
============================================================ | ||
Feature: #72309 - EXT:form - Integration of Predefined Forms | ||
============================================================ | ||
|
||
Description | ||
=========== | ||
|
||
The content element of EXT:form now allows the integration of predefined forms. An integrator can | ||
define forms - for example within a site package - using ``plugin.tx_form.predefinedForms``. An | ||
editor can add a new ``mailform`` content element to a page and choose a form from a list of | ||
predefined elements. | ||
|
||
There are even more advantages: | ||
|
||
- Integrators can build there forms with TypoScript which offers much more possibilites than doing | ||
it within the form wizard. Especially, the integrator is able to use stdWrap functionalities which | ||
are not available when using the form wizard (for security reasons). | ||
- There is no need anymore for editors to use the form wizard. They can choose the predefined forms | ||
which are optimized layout-wise. | ||
- Forms can be re-used throughout the whole installation. | ||
- Forms can be stored outside the DB and versionized. | ||
|
||
In order to be able to select the pre-defined form in the backend, the form has to be registered | ||
using PageTS. | ||
|
||
.. code-block:: typoscript | ||
TCEFORM.tt_content.tx_form_predefinedform.addItems.contactForm = LLL:EXT:my_theme/Resources/Private/Language/locallang.xlf:contactForm | ||
Example form: | ||
|
||
.. code-block:: typoscript | ||
plugin.tx_form.predefinedForms.contactForm = FORM | ||
plugin.tx_form.predefinedForms.contactForm { | ||
enctype = multipart/form-data | ||
method = post | ||
prefix = contact | ||
confirmation = 1 | ||
postProcessor { | ||
1 = mail | ||
1 { | ||
recipientEmail = test@mail.com | ||
senderEmail = test@mail.com | ||
subject { | ||
value = Contact form | ||
lang.de = Kontakt Formular | ||
} | ||
} | ||
} | ||
10 = TEXTLINE | ||
10 { | ||
name = name | ||
type = text | ||
required = required | ||
label { | ||
value = Name | ||
lang.de = Name | ||
} | ||
placeholder { | ||
value = Enter your name | ||
lang.de = Name eingeben | ||
} | ||
} | ||
20 = TEXTLINE | ||
20 { | ||
name = email | ||
type = email | ||
required = required | ||
label { | ||
value = Email | ||
lang.de = E-Mail | ||
} | ||
placeholder { | ||
value = Enter your email address | ||
lang.de = E-Mail Adresse eingeben | ||
} | ||
} | ||
30 = TEXTAREA | ||
30 { | ||
name = message | ||
cols = 40 | ||
rows = 5 | ||
required = required | ||
label { | ||
value = Message | ||
lang.de = Nachricht | ||
} | ||
placeholder { | ||
value = Enter your message | ||
lang.de = Nachricht eingeben | ||
} | ||
} | ||
40 = SUBMIT | ||
40 { | ||
name = 5 | ||
type = submit | ||
value { | ||
value = Send | ||
lang.de = Senden | ||
} | ||
} | ||
} |
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
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
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,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff"> | ||
<file t3:id="1450450398" source-language="en" datatype="plaintext" original="messages" date="2015-12-18T15:53:55Z" product-name="form"> | ||
<header/> | ||
<body> | ||
<trans-unit id="tx_form_predefinedform"> | ||
<source>Predefined form</source> | ||
</trans-unit> | ||
<trans-unit id="tx_form_predefinedform.selectPredefinedForm"> | ||
<source>Choose a predefined form</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# | ||
# Table structure for table 'tt_content' | ||
# | ||
CREATE TABLE tt_content ( | ||
tx_form_predefinedform varchar(255) DEFAULT '' NOT NULL, | ||
); |