b13 / listelements
Adds list elements to tt_content
Installs: 29 268
Dependents: 0
Suggesters: 1
Security: 0
Stars: 8
Watchers: 9
Forks: 2
Open Issues: 2
Type:typo3-cms-extension
Requires
- php: ^7.4 || ~8.0
- typo3/cms-backend: ^11.5 || ^12.4 || ^13.1
- typo3/cms-fluid-styled-content: ^11.5 || ^12.4 || ^13.1
Requires (Dev)
- b13/listelements-example: *
- saschaegerer/phpstan-typo3: ^1.8
- typo3/cms-frontend: ^11.5 || ^12.4 || ^13.1
- typo3/cms-workspaces: ^11.5 || ^12.4 || ^13.1
- typo3/coding-standards: ^0.5.5
- typo3/testing-framework: ^7.0 || ^8.0
- dev-master
- 1.3.1
- 1.3.0
- 1.2.0
- 1.1.0
- 1.0.2
- 1.0.1
- 1.0.0
- 0.3.1
- 0.3.0
- 0.2.5
- 0.2.4
- 0.2.3
- 0.2.2
- 0.2.1
- 0.2.0.x-dev
- 0.2.0
- 0.1.8
- 0.1.7
- v0.1.6
- v0.1.5
- v0.1.4
- v0.1.3
- v0.1.2
- v0.1.1
- v0.1.0
- dev-bugfix/php-version
- dev-sqlPerformance
- dev-task/dataprocessor
- dev-bmack-patch-1
- dev-bugfix/php8-fallback
- dev-remove-custom-fileservice
- dev-workspace-backend-previews
- dev-BEXT-324
- dev-bugfix/deps
- dev-BEXT-251
This package is auto-updated.
Last update: 2024-11-02 15:44:41 UTC
README
About this extension
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.
Installation
Add the extension to your project by installing and adding the TypoScript setup to your site-Extension setup:
@import 'EXT:listelements/Configuration/TypoScript/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>
Backend PageLayoutView preview
This extension adds a Hook and a Service class to allow customized display using Fluid templates for the backend Page Layout View. Use this to add customized preview data if you add additional assets/image fields to be resolved for backend preview:
EXT:site_extension/Classes/Hooks/DrawItem.php
:
<?php
namespace B13\SiteExtension\Hooks;
use TYPO3\CMS\Backend\View\PageLayoutViewDrawItemHookInterface;
use TYPO3\CMS\Backend\View\PageLayoutView;
/**
* Class/Function to manipulate the rendering of item preview content
*
*/
class DrawItem implements PageLayoutViewDrawItemHookInterface
{
/**
* @param PageLayoutView $parentObject : The parent object that triggered this hook
* @param boolean $drawItem : A switch to tell the parent object, if the item still must be drawn
* @param string $headerContent : The content of the item header
* @param string $itemContent : The content of the item itself
* @param array $row : The current data row for this item
*
* @return void
*/
public function preProcess(PageLayoutView &$parentObject, &$drawItem, &$headerContent, &$itemContent, array &$row)
{
// get all list items (database column 'test_list') including all assets
if ($row['test_list']) {
// array &$row, $field = '', $table = 'tt_content', $filereferences = 'assets, additional_assets'
\B13\Listelements\Service\ListService::resolveListitems($row, 'test_list', 'tt_content');
}
}
}
Important info on configuration
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.