Skip to content

Commit

Permalink
[FEATURE] Add form configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszuznanski committed Apr 8, 2024
1 parent 1fa3bf0 commit b625330
Show file tree
Hide file tree
Showing 6 changed files with 163 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@

renderingOptions:
submitButtonLabel: Submit
identifier: contactform
label: 'Contact form'
type: Form
prototypeName: standard
finishers:
-
options:
subject: 'Your message: {subject}'
recipients:
[email protected]: 'Your Company name'
senderAddress: '{email}'
senderName: '{name}'
format: html
attachUploads: true
translation:
language: default
title: 'Confirmation of your message'
identifier: EmailToReceiver
renderables:
-
renderingOptions:
previousButtonLabel: 'Previous step'
nextButtonLabel: 'Next step'
identifier: page-1
label: 'Contact Form'
type: Page
renderables:
-
defaultValue: ''
identifier: name
label: Name
type: Text
properties:
fluidAdditionalAttributes:
placeholder: Name
autocomplete: name
validators:
-
identifier: NotEmpty
-
defaultValue: ''
identifier: subject
label: Subject
type: Text
properties:
fluidAdditionalAttributes:
placeholder: Subject
validators:
-
identifier: NotEmpty
-
defaultValue: ''
identifier: email
label: Email
type: Email
properties:
fluidAdditionalAttributes:
placeholder: 'Email address'
autocomplete: email
validators:
-
identifier: NotEmpty
-
identifier: EmailAddress
-
defaultValue: ''
identifier: message
label: Message
type: Textarea
properties:
fluidAdditionalAttributes:
placeholder: ''
validators:
-
identifier: NotEmpty
-
renderingOptions:
previousButtonLabel: 'Previous step'
nextButtonLabel: 'Next step'
identifier: summarypage
label: 'Summary page'
type: SummaryPage
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
TYPO3:
CMS:
Form:
persistenceManager:
allowSaveToExtensionPaths: false
allowedExtensionPaths:
10: EXT:restaurant/Configuration/Sets/Restaurant/Form/FormDefinition/
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
lib.dynamicContent = COA
lib.dynamicContent {
5 = LOAD_REGISTER
5 {
colPos.cObject = TEXT
colPos.cObject {
field = colPos
ifEmpty.cObject = TEXT
ifEmpty.cObject {
value.current = 1
ifEmpty = 0
}
}
pageUid.cObject = TEXT
pageUid.cObject {
field = pageUid
ifEmpty.data = TSFE:id
}
contentFromPid.cObject = TEXT
contentFromPid.cObject {
data = DB:pages:{register:pageUid}:content_from_pid
data.insertData = 1
}
wrap.cObject = TEXT
wrap.cObject {
field = wrap
}
}
20 = CONTENT
20 {
table = tt_content
select {
includeRecordsWithoutDefaultTranslation = 1
orderBy = sorting
where = {#colPos}={register:colPos}
where.insertData = 1
pidInList.data = register:pageUid
pidInList.override.data = register:contentFromPid
}
stdWrap {
dataWrap = {register:wrap}
required = 1
}
}
90 = RESTORE_REGISTER
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ page {
headerData {
3 = TEXT
3.value = <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
4 = TEXT
4.value = <link rel="icon" href="favicon.svg">
}
footerData {
3 = TEXT
3.value = <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>

}
}
page.10 = PAGEVIEW
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<f:layout name="Default" />
<f:layout name="Default"/>
<f:section name="Header">
<f:render partial="Header"/>
<f:render partial="MainNavigation" arguments="{mainNavigation: mainNavigation}" />
<f:render partial="LanguageNavigation" arguments="{languageNavigation: languageNavigation}" />
<f:render partial="SocialMediaNavigation" arguments="{socialMediaNavigation: socialMediaNavigation}" />
<f:render partial="MainNavigation" arguments="{mainNavigation: mainNavigation}"/>
<f:render partial="LanguageNavigation" arguments="{languageNavigation: languageNavigation}"/>
<f:render partial="SocialMediaNavigation" arguments="{socialMediaNavigation: socialMediaNavigation}"/>
</f:section>
<f:section name="Content">
<f:cObject typoscriptObjectPath="lib.dynamicContent" data="{pageUid: '{data.uid}', colPos: '0'}"/>
</f:section>
<f:section name="Footer">
<f:render partial="Footer"/>
<f:render partial="FooterNavigation" arguments="{footerNavigation: footerNavigation}" />
<f:render partial="SocialMediaNavigation" arguments="{socialMediaNavigation: socialMediaNavigation}" />
<f:render partial="FooterNavigation" arguments="{footerNavigation: footerNavigation}"/>
<f:render partial="SocialMediaNavigation" arguments="{socialMediaNavigation: socialMediaNavigation}"/>
</f:section>
16 changes: 16 additions & 0 deletions local_packages/restaurant/ext_typoscript_setup.typoscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.tx_form {
settings {
yamlConfigurations {
100 = EXT:restaurant/Configuration/Sets/Restaurant/Form/Setup.yaml
130 = EXT:restaurant/Configuration/Sets/Restaurant/Form/FormDefinition/Contactform.form.yaml
}
}
}
plugin.tx_form {
settings {
yamlConfigurations {
100 = EXT:restaurant/Configuration/Sets/Restaurant/Form/Setup.yaml
130 = EXT:restaurant/Configuration/Sets/Restaurant/Form/FormDefinition/Contactform.form.yaml
}
}
}

0 comments on commit b625330

Please sign in to comment.