2014-11-14 55 views
0

我想在新消息模塊的後端添加一個字段。對於我創建了3個文件一個新的擴展它:展開tx_news TCA

ext_emconf.php

<?php 

$EM_CONF[$_EXTKEY] = array(
    'title' => 'Expand news', 
    'description' => 'Expand news', 
    'category' => 'fe', 
    'author' => 'SOG', 
    'author_email' => '-', 
    'shy' => '', 
    'dependencies' => '', 
    'conflicts' => '', 
    'priority' => '', 
    'module' => '', 
    'state' => 'stable', 
    'internal' => '', 
    'uploadfolder' => 0, 
    'createDirs' => '', 
    'modify_tables' => '', 
    'clearCacheOnLoad' => 0, 
    'lockType' => '', 
    'author_company' => '', 
    'version' => '0.1.0', 
    'constraints' => array(
     'depends' => array(
     ), 
     'conflicts' => array(
     ), 
     'suggests' => array(
     ), 
    ), 
    '_md5_values_when_last_written' => '', 
    'suggests' => array(
    ), 
); 

?> 

ext_tables.php

<?php 
/*if (!defined('TYPO3_MODE')) { 
    die ('Access denied.'); 
}*/ 
$tempColumns = array(
    'tx_sogexpandnews_test' => array(  
     'exclude' => 0,  
     'label' => 'test',  
     'config' => array(
      'type' => 'text', 
      'cols' => '30', 
      'rows' => '5', 
     ) 
    ), 
); 


t3lib_div::loadTCA('tx_news_domain_model_news'); 
t3lib_extMgm::addTCAcolumns('tx_news_domain_model_news',$tempColumns,1); 
t3lib_extMgm::addToAllTCAtypes('tx_news_domain_model_news','tx_sogexpandnews_test', '', 'after:title')); 

?> 

ext_tables.sql

# 
# Table structure for table 'news' 
# 
CREATE TABLE tx_news_domain_model_news (
    tx_sogexpandnews_test text 
); 

該油田在數據庫中,但當我想創建新的新聞項目時,我沒有看到後端的字段。

我也檢查了LocalConfiguation.php,並確保我的擴展名屬於新聞擴展名。

任何想法我想念什麼?

回答

1

我不能說出爲什麼,但我停用了新聞,更新了它並重新安裝了它,現在我看到了該字段。

+0

,如果你犯了一個新的數據庫字段(或表),你必須每次運行「比較數據庫」的安裝工具。 – brandelizer 2014-11-18 17:09:10

1

緩存 - 緩存 - 緩存...始終緩存。

如果您需要確定,請始終刪除typo3temp中的所有內容,並清空數據庫中的所有cf_ *表。

(停用並重新安裝幾乎做了同樣的)