In TYPO3 I want to make an element that allows the user to create multiple sub-blocks within it. For example:
Create New +
|
|- Sub Block
| |- Assets
| |- Text Field
|
|- Sub Block
| |- Assets
| |- Text Field
From what I understand this is done using type='inline'
However the documentation assumes you know all previous steps of the process, and I have found no tutorials on this kind of element.
To add a new content element with a 1:n relation to a new record (not content element), you have to add a new record and a new property of tt_content describing the relation between tt_content and your record.
As a basic example, I create a new record "my_list_item" and a new content element "my_list":
Add new table for your new record (ext_tables.sql):
Describe new record in TCA (Configuration/TCA/tx_myext_domain_model_mylistitem.php
Allow record on pages (ext_tables.php):
Describe the TCA of the new record with the relation to itself (Configuration/TCA/Overrides/tt_content.php)
Extend tt_content (ext_tables.sql)
Add a new content element (Configuration/TCA/Overrides/tt_content.php):
This is just a basic example, reduced and replaced names from a working example I made a few weeks ago. Should I missed something, comment.
BTW: This is the same way which mask / mask exports handles repeatable elements. So of course you can also use mask export and clean the generated code for your own purpose (the code is of mask export is good and usable, but there is a bit overhead, as it must be more generic)