This extension adds list items to tt_content. It adds a database field tx_listelements_list to tt_content that
allows adding flexible list items as IRRE records to any content element.
Add the extension to your project by installing it and adding the site set b13/listelements as a dependency of
your site set (or selecting it in the site configuration):
dependencies:
- b13/listelementsIf you do not use site sets, import the TypoScript setup in your site extension instead:
@import 'EXT:listelements/Configuration/Sets/listelements/setup.typoscript'
This adds the configuration for adding the list items as an array listitems to the variables available for your
content element's Fluid template, like this:
<f:for each="{listitems}" as="item">
...
</f:for>
if you use record-transformation dataProcessing for your content-elements the EXT:listelements Site-Set (the TypoScript) is not required you can do
tt_content.<my-ce>.dataProcessing.10 = record-transformation
then you have adapt your templates, e.g.
<f:for each="{record.tx_listelements_list}" as="item">
...
</f:for>
and also the items self, e.g.
{item.header}
{item.images}
instead of
{item.data.header}
{item.listimages}
This extension adds a PageContentPreviewRendering Listener to resolve ListItems (and if needed further Relations to asses/images) to allow customized display using Fluid templates for the backend Page Layout View.
For TYPO3 Version > 12 the Listener is not required anymore, because TYPO3 use the Record Api to resolve relations automatically.
For TYPO3 Version > 13 the Listener is not used anymore (because the Event changed)
Migrate or BE-Templates
old:
<ul>
<f:for each="{listitems}" as="item">
<li>
{item.header}
<f:if condition="{item.processedImages}">
<f:for each="{item.processedImages}" as="image">
<f:image src="{image.uid}" treatIdAsReference="true"/>
</f:for>
</f:if>
</li>
</f:for>
</ul>new:
<ul>
<f:for each="{record.tx_listelements_list}" as="item">
<li>
{item.header}
<f:if condition="{item.images}">
<f:for each="{item.images}" as="image">
<f:image src="{image.uid}" treatIdAsReference="true"/>
</f:for>
</f:if>
</li>
</f:for>
</ul>Remember to add the hiddenpalette to all showitems-configuration for your own content elements to have invisible
fields like the language uid saved for all list items.
List Elements was created by David Steeb and is maintained by b13 GmbH, Stuttgart, Germany.
Find more TYPO3 extensions we have developed that help us deliver value in client projects. As part of our work, we focus on testing and best practices to ensure long-term performance, reliability, and results in all our code.