Last active
June 21, 2023 13:01
-
-
Save caseywilliams/8815747 to your computer and use it in GitHub Desktop.
Various TYPO3 formhandler snippets
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
# 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