Skip to content

Instantly share code, notes, and snippets.

@cepheiVV
Last active June 7, 2022 14:19
Show Gist options
  • Save cepheiVV/e3ba237345d0d9d8f3f9547981886e95 to your computer and use it in GitHub Desktop.
Save cepheiVV/e3ba237345d0d9d8f3f9547981886e95 to your computer and use it in GitHub Desktop.
TYPO3 Flexform Snippets
# ---------------------------------------------- #
# #
# A collection of TYPO3 flexform snippets #
# #
# ---------------------------------------------- #
<settings.categories>
<label>Categorories</label>
<config>
<type>select</type>
<renderType>selectTree</renderType>
<foreign_table>sys_category</foreign_table>
<foreign_table_where> AND sys_category.sys_language_uid IN (-1, 0) ORDER BY sys_category.sorting ASC</foreign_table_where>
<size>10</size>
<treeConfig>
<parentField>parent</parentField>
<appearance>
<expandAll>true</expandAll>
<showHeader>true</showHeader>
</appearance>
</treeConfig>
</config>
</settings.categories>
<settings.myCheckbox>
<label>Checkbox</label>
<config>
<type>check</type>
</config>
</settings.myCheckbox>
<settings.selectFromDb>
<label>Selectbox from Database</label>
<config>
<type>select</type>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0"></numIndex>
<numIndex index="1"></numIndex>
</numIndex>
</items>
<foreign_table>tt_content</foreign_table>
<foreign_table_where>
AND tt_content.pid = 22
</foreign_table_where>
</config>
</settings.selectFromDb>
<settings.date>
<label>Date</label>
<config>
<type>input</type>
<renderType>inputDateTime</renderType>
<eval>datetime</eval>
</config>
</settings.date>
<settings.label>
<label>Input</label>
<config>
<type>input</type>
<size>20</size>
<max>30</max>
<eval>trim</eval>
</config>
</settings.label>
<label>LLL:EXT:my_extension/Resources/Private/Language/locallang_be.xlf:myLabel</label>
<settings.options>
<label>Selectbox mehrfach</label>
<config>
<type>select</type>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0">Option label 1</numIndex>
<numIndex index="1">option-1</numIndex>
</numIndex>
<numIndex index="1" type="array">
<numIndex index="0">Option label 2</numIndex>
<numIndex index="1">option-2</numIndex>
</numIndex>
<numIndex index="3" type="array">
<numIndex index="0">Option label 3</numIndex>
<numIndex index="1">option-3</numIndex>
</numIndex>
</items>
<maxitems>3</maxitems>
<size>3</size>
</config>
</settings.options>
<settings.option>
<label>Radiobuttons</label>
<config>
<type>radio</type>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0">Option label 1</numIndex>
<numIndex index="1">option-1</numIndex>
</numIndex>
<numIndex index="1" type="array">
<numIndex index="0">Option label 2</numIndex>
<numIndex index="1">option-2</numIndex>
</numIndex>
<numIndex index="3" type="array">
<numIndex index="0">Option label 3</numIndex>
<numIndex index="1">option-3</numIndex>
</numIndex>
</items>
</config>
</settings.option>
<settings.text>
<label>Textarea</label>
<config>
<type>text</type>
<cols>24</cols>
<rows>3</rows>
</config>
<defaultExtras>richtext[*]:rte_transform[mode=ts_css]</defaultExtras>
</settings.text>
<settings.select>
<label>Selectbox</label>
<config>
<type>select</type>
<renderType>selectSingle</renderType>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0">Option label 1</numIndex>
<numIndex index="1">option-1</numIndex>
</numIndex>
<numIndex index="1" type="array">
<numIndex index="0">Option label 2</numIndex>
<numIndex index="1">option-2</numIndex>
</numIndex>
<numIndex index="3" type="array">
<numIndex index="0">Option label 3</numIndex>
<numIndex index="1">option-3</numIndex>
</numIndex>
</items>
</config>
</settings.select>
<settings.startingpoint>
<label>Startingpoint</label>
<config>
<type>group</type>
<internal_type>db</internal_type>
<allowed>pages</allowed>
<size>1</size>
<maxitems>1</maxitems>
<minitems>0</minitems>
<show_thumbs>1</show_thumbs>
</config>
</settings.startingpoint>
<settings.selectByTsConfig>
<label>Select with options from ts_config</label>
<config>
<type>select</type>
<itemsProcFunc>GeorgRinger\News\Hooks\ItemsProcFunc->user_templateLayout</itemsProcFunc>
<renderType>selectSingle</renderType>
<items>
<numIndex index="0" type="array">
<numIndex index="0"></numIndex>
<numIndex index="1"></numIndex>
</numIndex>
</items>
</config>
</settings.selectByTsConfig>
# PHP
# see
# `GeorgRinger\News\Hooks\ItemsProcFunc->user_templateLayout` and
# `GeorgRinger\News\Utility\TemplateLayout->getAvailableTemplateLayouts`
# of `EXT:news`
# TS Page Config
tx_myextension {
someSettings {
setting_1 = 1
setting_2 = 2
}
}
<T3DataStructure>
<sheets>
<sDEF>
<ROOT>
<TCEforms>
<sheetTitle>Settings</sheetTitle>
</TCEforms>
<type>array</type>
<el>
...
</el>
</ROOT>
</sDEF>
</sheets>
</T3DataStructure>
<T3DataStructure>
<sheets>
<sDEF>
<ROOT>
<TCEforms>
<sheetTitle>Tab 1</sheetTitle>
</TCEforms>
<type>array</type>
<el>
...
</el>
</ROOT>
</sDEF>
<tabTwo>
<ROOT>
<TCEforms>
<sheetTitle>Tab 2</sheetTitle>
</TCEforms>
<type>array</type>
<el>
...
</el>
</ROOT>
</tabOne>
</sheets>
</T3DataStructure>
<settings.plaintext>
<label>Textarea</label>
<config>
<type>text</type>
<cols>24</cols>
<rows>3</rows>
</config>
</settings.plaintext>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment