Why using a Site Package: http://de.slideshare.net/benjaminkott/typo3-the-anatomy-of-sitepackages
See: https://docs.typo3.org/typo3cms/extensions/fluid_styled_content/latest/AddingYourOwnContentElements/
This will show your new element in the content element wizard
# Custom Contentelements based on fluid mod.wizards.newContentElement.wizardItems.common { elements { myextkey_elementname { iconIdentifier = content-image title = Give it a nice name description = Describe what this element is supposed to do tt_content_defValues { CType = myextkey_elementname } } } show := addToList(myextkey_elementname) }
// Adds the content element to the "Type" dropdown \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin( array( 'Name in dropdown', 'myextkey_elementname', 'EXT:core/Resources/Public/Icons/T3Icons/content/content-image.svg' ), 'CType', 'myextkey' ); // Add a custom palette $GLOBALS['TCA']['tt_content']['types']['general_modified'] = [ 'label' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:palette.headers', 'showitem' => 'header;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:header_formlabel' ]; // Configure the default backend fields for the content element $GLOBALS['TCA']['tt_content']['types']['myextkey_elementname'] = array( 'showitem' => ' --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general, --palette--;;general_modified, --palette--;;headers, --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.images,image, --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language, --palette--;;language, --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access, --palette--;;hidden, --palette--;;access, ', 'columnsOverrides' => [ 'bodytext' => [ 'config' => [ 'enableRichtext' => true, 'richtextConfiguration' => 'default' ] ] ] );
lib.contentElement { templateRootPaths { 200 = EXT:myextkey/Resources/Private/Templates/ } }
# Add template path for your extension lib.contentElement { templateRootPaths { 200 = EXT:myextkey/Resources/Private/Templates/ } } # Load defaults and define Template tt_content { myextkey_elementname =< lib.contentElement myextkey_elementname { templateName = NameOfYourTemplate } }
Depending on which contentelement this is based on you can simply load.
For example this element should be based on image
:
tt_content { myextkey_elementname =< tt_content.image myextkey_elementname { templateName = NameOfYourTemplate } }
You'll find all available CEs in typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/
.
$GLOBALS['TCA']['tt_content']['types']['CTYPE_NAME']['columnsOverrides']['image']['config']['maxitems'] = 3; $GLOBALS['TCA']['tt_content']['types']['CTYPE_NAME']['columnsOverrides']['image']['config']['minitems'] = 3;