Skip to content

Instantly share code, notes, and snippets.

@caseywilliams
Last active June 21, 2023 13:01
Show Gist options
  • Save caseywilliams/8815747 to your computer and use it in GitHub Desktop.
Save caseywilliams/8815747 to your computer and use it in GitHub Desktop.
Various TYPO3 formhandler snippets
# Autofilling formhandler field values from fe_user accounts
#####
plugin.Tx_Formhandler.settings.predef.formName {
...
# Autofill contact information
preProcessors {
1 {
class = Tx_Formhandler_PreProcessor_LoadDefaultValues
config {
# For step 1
1 {
# Use getText to get field values
f_first_name.defaultValue = TEXT
f_first_name.defaultValue.data = TSFE:fe_user|user|first_name
# et cetera...
}
}
}
}
...
}
# Simple conditional require
# This one checks the radio field "in_us", and if it's set to "no", the "country" field is required
# See http://www.typo3-formhandler.com/blog/howtos/how-to-set-up-a-multistep-form-with-conditions/
#####
plugin.Tx_Formhandler.settings.predef.blah {
...
if {
1 {
conditions.OR1.AND1 = in_us=no
isTrue {
validators.1.config.fieldConf.country.errorCheck.1 = required
}
}
}
...
}
# Use a form field (POSTvar) in an email template
# In this example you'd put ###meeting_title### in the email template
#####
plugin.Tx_Formhandler.settings.predef.formName {
markers {
meeting_title = CONTENT
meeting_title {
table = tx_cal_category
select {
pidInList = 1375
selectFields = title
where = uid={GP:farmerforms|meeting_type}
where.stdWrap.insertData = 1
}
renderObj = TEXT
renderObj.field = title
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment