2017-04-10 100 views
0

我試圖做自己的發行,但仍然卡在TCA腳本... 我試圖做一個自己的內容元素,也工作。但是,如果我想將Textarea作爲RichTextEditor或輸入字段顯示爲ValuePicker,它將不起作用。TYPO3 CMS7 TCA - RTE和ValuePicker

所以這是我在tt_content.php

$GLOBALS['TCA']['tt_content']['columns']['testText'] = array(
    'exclude' => 1, 
    'label' => 'LLL:EXT:PRIVATE/Resources/Private/Language/locallang_tabs.xlf:tesText', 
    'config' => array(
     'type' => 'text', 
     'cols' => 40, 
     'rows' => 6, 
     'wizards' => array(
      '_PADDING' => 2, 
      'RTE' => array(
       'notNewRecords' => 1, 
       'RTEonly' => 1, 
       'type' => 'script', 
       'title' => 'Full Test', 
       'module' => array(
        'name' => 'wizard_rte' 
       ), 
       'icon' => 'wizard_rte2.gif' 
      ) 
     ), 
     'enableRichtext' => true, 
     'defaultExtras' => 'richtext[]' 
    ) 
); 

代碼在後端我只能看到正常的textarea的,沒有RTE甚至ValuePicker。即使我將調色板類型更改爲Bodytext,如下所示,有一個Textarea。

$GLOBALS['TCA']['tt_content']['types']['PRIVATE_termin'] = array(
    'showitem' => ' 
     --palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xml:palette.general;general, 
     --palette--;LLL:EXT:PRIVATE/Resources/Private/Language/locallang_tabs.xlf:general, header, bodytext, termin, termin2, platz, farbe 
'); 

我所定義的ValuePicker如下:

$GLOBALS['TCA']['tt_content']['columns']['farbe'] = array(
    'label' => 'LLL:EXT:PRIVATE/Resources/Private/Language/locallang_tabs.xlf:farbe', 
    'config' => array(
     'type' => 'input', 
     'size' => 20, 
     'valuePicker' => array(
      'items' => array(
       ['#496D0C', '<font color="#496D0C">Neutral</font>'], 
       ['#91AD33', '<font color="#91AD33">Gr&uuml;n</font>'], 
       ['#F59B00', '<font color="#F59B00">Gelb</font>'], 
       ['#CD1013', '<font color="#CD1013">Rot</font>'] 
      ), 
     ) 
    ) 
); 

我還試圖刪除HTML標籤,但它仍然是行不通的。

我期待着你的:)

MFG Ascawath

回答

0

對於TYPO3 7 LTS。 RTE字段的TCA配置。如下所示。

'description' => array(
    'exclude' => 1, 
    'label' => 'LLL:EXT:ext_list/Resources/Private/Language/locallang_db.xlf:tx_extlist_domain_model_extlist.description', 
    'config' => array(
      'type' => 'text', 
      'cols' => '30', 
      'rows' => '3' 
    ), 
    'defaultExtras' => 'richtext[strong|emphasis]:rte_transform[ts]' 
), 
+0

謝謝:) 你對價值選擇者有什麼想法嗎? – ascawath

0

聽到你能否使RTE 'columnsOverrides'

$GLOBALS['TCA']['tt_content']['types']['startpilot_textimage'], 
 
    [ 
 
     'showitem' => $showitem_default_01 . ' 
 
     header;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:header_formlabel, 
 
     header_layout;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:header_layout_formlabel, 
 
     imageposition, 
 
     image, 
 
     bodytext, 
 
     ' . $showitem_default_02, 
 
     'columnsOverrides' => [ 
 
      'bodytext' => ['defaultExtras' => 'richtext:rte_transform[mode=ts_css]'], 
 
      'image' => array(
 
       'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
 
        'image', 
 
        array(
 
         'collapseAll' => 1, 
 
         'maxitems' => 1, 
 
        ) 
 
       ), 
 
      ), 
 
     ] 
 
    ]

+0

感謝您的幫助:) – ascawath

+0

你知道的價值選擇器任何幫助嗎? – ascawath