저는 TYPO3 (첫 번째 프로젝트)을 처음 사용하고 colorpicker가 포함 된 사용자 지정 요소 만들기에 대한 몇 가지 이해 문제가 있습니다. 이 프로젝트에서 저는 이미 몇 가지 요소를 만들었지 만, 백엔드 입력을 위해 미리 지정된 필드 만 사용합니다. 다음에 필요한 요소의 경우 사용자가 색상을 선택해야합니다. 나는 맞는 기존 요소를 찾지 못했습니다. 작동하지 않는 설정은 TCA/Overrides/tt_content.php
파일에 있으며 다음과 같습니다.TYPO3 사용자 지정 요소 colorpicker
$GLOBALS['TCA']['tt_content']['item_0']=array();
$GLOBALS['TCA']['tt_content']['item_0']['label']='Color';
$GLOBALS['TCA']['tt_content']['item_0']['config']=array();
$GLOBALS['TCA']['tt_content']['item_0']['config']['type']='input';
$GLOBALS['TCA']['tt_content']['item_0']['config']['renderType']='colorpicker';
$GLOBALS['TCA']['tt_content']['item_0']['config']['size']=10;
$GLOBALS['TCA']['tt_content']['types']['wo_mitem'] = array(
'showitem' => '--palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.general;general,
header;Title,
subheader;Background,
header_link;Target,
item_0;Color,
bodytext;Text;;richtext:rte_transform[flag=rte_enabled|mode=ts_css]
');
item_0
은 colorpicker를 만들려고했지만 작동하지 않는 것 같습니다. 다른 파일에서 다른 것을 필요합니까? 내 필드를 정의하기 위해 추가 한 처음 몇 줄. 이 작업을 수행하는 더 좋은 방법이 있습니까?
내 모든 맞춤 구성 요소가 정상적으로 작동하므로 내 맞춤 확장 작업의 다른 모든 파일이 작동합니다. 유일한 차이점은 새로 말한 것에서 색상을 선택하는 방법이 필요하다는 것입니다.
lib.contentElement {
templateRootPaths {
100 = EXT:wostyle/Resources/Private/Template
}
}
tt_content {
wo_mitem < lib.contentElement
wo_mitem {
templateName = MItem
}
}
tt_content.php
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(
array(
'WO_Item (ItemBox, Text only)',
'wo_mitem',
'content-image'
),
'CType',
'wostyle'
);
$GLOBALS['TCA']['tt_content']['item_0']=array();
$GLOBALS['TCA']['tt_content']['item_0']['label']='Farbe';
$GLOBALS['TCA']['tt_content']['item_0']['config']=array();
$GLOBALS['TCA']['tt_content']['item_0']['config']['type']='input';
$GLOBALS['TCA']['tt_content']['item_0']['config']['renderType']='colorpicker';
$GLOBALS['TCA']['tt_content']['item_0']['config']['size']=10;
$GLOBALS['TCA']['tt_content']['types']['wo_mitem'] = array(
'showitem' => '--palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.general;general,
header;Bezeichnung,
subheader;Chemische Bezeichnung,
header_link;Zielseite,
item_0;Farbe,
bodytext;Text;;richtext:rte_transform[flag=rte_enabled|mode=ts_css]
');
typo.ts
mod.wizards.newContentElement.wizardItems.wo_extra {
header = WO Elemente
after = common
elements {
wo_mitem {
iconIdentifier = content-image
title = WO_Item (ItemBox, Text only)
description = Ein Produktfeld mit Text
tt_content_defValues {
CType = wo_mitem
}
}
}
show := addToList(wo_mitem)
}
MItem
: 그냥 여기에 명확하게 보이는 다른 파일SETUP.TXT에 대한
. html
<div class="item-text">
<f:link.typolink parameter="{data.header_link}">
<div class="item-front">
<f:if condition="{data.subheader}!=''">
<f:then>
<div class="item-bg">
<f:format.html>{data.subheader}</f:format.html>
</div>
</f:then>
</f:if>
<div class="item-title">
<f:format.html>{data.header}</f:format.html>
</div>
</div>
<div class="item-back">
<f:format.html>{data.bodytext}</f:format.html>
</div>
</f:link.typolink>
</div>
<f:debug>{data}</f:debug>
편집 : 나는 전체 코드를 확인하지 않았다 TYPO3 8.7.8
대단히 감사합니다. 이제 작동합니다. "열"이 누락되었으며 테이블 자체의 item_0 필드도 누락되었습니다. :) – Nyxeen