How to fill your own markers via TypoScript
Basic example: Simple markers
Add these markers into your template:
###myMarker_1###
###myMarker_2###
###myMarker_3###
Register the markers in TypoScript.
plugin.Tx_Formhandler.settings.predef.myForm.markers.myMarker_1 = TEXT
plugin.Tx_Formhandler.settings.predef.myForm.markers.myMarker_1.value = My marker content
# getText function
plugin.Tx_Formhandler.settings.predef.myForm.markers.myMarker_2 = TEXT
plugin.Tx_Formhandler.settings.predef.myForm.markers.myMarker_2.data = getIndpEnv:HTTP_HOST
# Constant insertion
plugin.Tx_Formhandler.settings.predef.myForm.markers.myMarker_3 = TEXT
plugin.Tx_Formhandler.settings.predef.myForm.markers.myMarker_3.value = {$local.myConstant}
###myMarker_1### will be filled with “My marker content”.
###myMarker_2### will be filled with the host name of your webserver.
###myMarker_3### will be filled with the content of the constant local.myConstant.
NOTE: You can fill your own markers using any TypoScript object like USER or COA. Just try it out.
Advanced example: Prefill a dropdown menu dynamically
Let's say you have dropdown menu in your HTML template that you may want to generate dynamically.
<select id="changeMe" name="changeMe"> <option value="">###LLL:selectValue###</option> ###options_dropdown### </select>
Next, you will need to write / adapt the following TypoScript
options_dropdown = CONTENT
options_dropdown {
table = tx_addresses_domain_model_address
select {
pidInList = 1
orderBy = last_name
selectFields = uid, first_name, last_name
# possible conditions
# where = ( tx_mytable.type='b0' OR tx_mytablet.type='b1' )
}
renderObj = COA
renderObj {
#value
10.wrap = <option value="|"
10 = TEXT
10.field = uid
#selected
12.noTrimWrap = | ###selected_mytable_|###>|
12 = TEXT
12.field = uid
#label
13 = TEXT
13.wrap = |</option>
13.field = first_name
}
}
