我在拼写错误7.6.2
时遇到了一些问题我想将自己的内容元素添加到内容元素向导中。
我自己的扩展模板,局部文件,TypoScript ......工作,元素在内容元素向导中可见。
如果我选择新元素并点击要添加的地点,则显示以下screen。
(ext_tables.php):
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile(
$_EXTKEY,
'Configuration/TypoScript',
'Template Extension'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('
mod {
wizards.newContentElement.wizardItems.extra {
header = KCW Inhalte
elements {
mitglied {
icon = ../typo3/sysext/core/Resources/Public/Icons/T3Icons/content/content-header.svg
title = Mitglied
description = Ein Mitglied anlegen
tt_content_defValues {
CType = mitglied
}
}
}
show = *
}
}
');
"配置/ TCA /重写/ tt_content.php&#34 ;:
$TCA['mitglied'] = array(
'columns' => array(
'name' => array (
'exclude' => 1,
'label' => 'Vorname Name',
'config' => array (
'type' => 'input',
'size' => '20'
)
),
'spitzname' => array (
'exclude' => 1,
'label' => 'Spitzname',
'config' => array (
'type' => 'input',
'size' => '20'
)
),
'geburtstag' => array (
'exclude' => 1,
'label' => 'Geburtstag',
'config' => array (
'type' => 'input',
'size' => '10',
'eval' => 'date',
)
),
'posten' => array (
'exclude' => 1,
'label' => 'Posten',
'config' => array (
'type' => 'select',
'renderType' => 'selectSingle',
'items' => array (
array('Mitglied'),
array('Präsident'),
array('Kassenwart'),
array('Vergnügungsausschuss'),
),
'size' => 1,
'maxitems' => 1,
)
),
'foto' => array (
'exclude' => 1,
'label' => 'Foto',
'config' => array(
'type' => 'group',
'internal_type' => 'file',
'allowed' => 'jpg',
'max_size' => 1000,
'uploadfolder' => 'uploads/pics/',
'show_thumbs' => 1,
'size' => 3,
'minitems' => 1,
'maxitems' => 1,
'autoSizeMax' => 10,
)
),
),
'types' => array(
'0' => array('showitem' => 'name,spitzname,geburtstag,posten,foto')
)
);
\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($GLOBALS['TCA']['tt_content'], $tcaTtContent);
我认为问题出在ext_tables.php的这些行中:
tt_content_defValues {
CType = mitglied
}
答案 0 :(得分:0)
您必须允许值null
作为字段mitglied
的值。 cType
只为新创建的内容元素设置默认值。
tt_content_devValues
https://docs.typo3.org/typo3cms/TSconfigReference/PageTsconfig/TCEform/Index.html#pagetceformconfobj