[TYPO3-german] TCA Eigenes Feld in file_reference nur für bestimmtes Element
M S
ms12345 at trashmail.de
Thu Dec 15 13:52:47 CET 2016
Hallo zusammen,
ich habe die sys_file_reference um ein Feld erweitert.
Leider taucht dieses Feld aktuell in allen Elementen auf (Text & Media, etc.) wo Mediaelemente eingebettet werden können.
Gerne würde ich das zusätzliche Feld ausschließlich in einem eigenen Content Element darstellen lassen. Allerdings funktioniert das wohl nicht. Vielleicht hat jemand einen Tip. Hier das was ich habe:
<?php
if (!defined('TYPO3_MODE')) {
die('Access denied.');
}
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'Configuration/TypoScript', 'Own Elements');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
'mod {
wizards.newContentElement.wizardItems.extra {
header = Own Elements
elements {
own_elements_stickymenu {
icon = EXT:own_elements_stickymenu/ext_icon.gif
title = Sticky side menu
description = Sticky menu
tt_content_defValues.CType = own_elements_stickymenu
}
}
show = *
}
}'
);
$TCA['tt_content']['columns']['CType']['config']['items']['own_elements_stickymenu'] = array(
'Own Elements (Sticky Menu)',
'own_elements_stickymenu',
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($_EXTKEY) . 'ext_icon.gif'
);
$TCA['tt_content']['types']['own_elements_stickymenu']['showitem'] = '
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xml:palette.general;general,
header;Name,
--div--;Bilder,
image,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xml:tabs.access,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xml:palette.visibility;visibility,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xml:palette.access;access,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xml:tabs.extended
';
$tempColumns = Array (
"own_elements_stickymenu_id" => Array (
'exclude' => 1,
'label' => 'Sticky Menu (Additional ID)',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns("sys_file_reference",$tempColumns);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('sys_file_reference', 'own_elements_stickymenu','own_elements_stickymenu');
$TCA['sys_file_reference']['palettes']['imageoverlayPalette']['showitem'] .= ',--linebreak--,own_elements_stickymenu_id,--palette--;LLL:EXT:t3pimper/locallang_db.xml:tt_content.own_elements_stickymenu_id;';
$TCA['sys_file_reference']['types']['1']['showitem'] .= ',--linebreak--,own_elements_stickymenu_id,--palette--;LLL:EXT:t3pimper/locallang_db.xml:tt_content.own_elements_stickymenu_id;';
--
Kind regards,
Michael
forum.typo3.org/index.php?t=tree&th=208338 direct_mail
forum.typo3.org/index.php?t=tree&th=210808 powermail
forum.typo3.org/index.php?t=tree&th=212804 Core
forum.typo3.org/index.php?t=tree&th=213115 clickenlarge
More information about the TYPO3-german
mailing list