这是有关如何将新字段添加到的链接fe_users
:https ://docs.typo3.org/typo3cms/TCAReference/ExtendingTca/Index.html
https://docs.typo3.org/typo3cms/TCAReference/ExtendingTca/Examples/Index。 html
我会给你一个例子,来自我的一个旧的、临时的扩展zusatzfelder
,它修改了“pages”表。它真的很旧,请验证一切是否都是最新的。您还可以查看任何其他“真实”扩展...
ext_emconf.php(可能由 extension_builder 创建)
<?php
########################################################################
# Extension Manager/Repository config file for ext "zusatzfelder".
#
# Auto generated 29-08-2011 15:33
#
# Manual updates:
# Only the data in the array - everything else is removed by next
# writing. "version" and "dependencies" must not be touched!
########################################################################
$EM_CONF[$_EXTKEY] = array(
'title' => 'Zusatzfelder',
'description' => '',
'category' => '',
'author' => '',
'author_email' => '',
'shy' => '',
'dependencies' => '',
'conflicts' => '',
'priority' => '',
'module' => '',
'state' => '',
'internal' => '',
'uploadfolder' => 0,
'createDirs' => '',
'modify_tables' => '',
'clearCacheOnLoad' => 0,
'lockType' => '',
'author_company' => '',
'version' => '0.0.0',
'constraints' => array(
'depends' => array(
),
'conflicts' => array(
),
'suggests' => array(
),
),
'_md5_values_when_last_written' => 'a:8:{s:9:"ChangeLog";s:4:"5b94";s:10:"README.txt";s:4:"ee2d";s:12:"ext_icon.gif";s:4:"1bdc";s:14:"ext_tables.php";s:4:"474a";s:14:"ext_tables.sql";s:4:"ead9";s:16:"locallang_db.xml";s:4:"7a92";s:19:"doc/wizard_form.dat";s:4:"0cba";s:20:"doc/wizard_form.html";s:4:"29e8";}',
);
?>
ext_tables.sql
CREATE TABLE pages (
tx_zusatzfelder_contentnav_title_addition tinytext,
tx_zusatzfelder_contentnav_title tinytext,
tx_zusatzfelder_contentnav_disable int(11) DEFAULT '0' NOT NULL,
);
ext_tables.php
<?php
if (!defined('TYPO3_MODE')) {
die ('Access denied.');
}
$tempColumns = array (
'tx_zusatzfelder_contentnav_title' => array (
'exclude' => 0,
'label' => 'LLL:EXT:zusatzfelder/locallang_db.xml:pages.tx_zusatzfelder_contentnav_title',
'config' => array (
'type' => 'input',
'size' => '30',
)
),
'tx_zusatzfelder_contentnav_title_addition' => array (
'exclude' => 0,
'label' => 'LLL:EXT:zusatzfelder/locallang_db.xml:pages.tx_zusatzfelder_contentnav_title_addition',
'config' => array (
'type' => 'input',
'size' => '30',
)
),
'tx_zusatzfelder_contentnav_disable' => array (
'exclude' => 0,
'label' => 'LLL:EXT:zusatzfelder/locallang_db.xml:pages.tx_zusatzfelder_contentnav_disable',
'config' => array (
'type' => 'check',
'default' => '0',
)
),
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('pages',$tempColumns,1);
// http://typo3-blog.net/tutorials/news/addtoalltcatypes.html
// PS: the "after:"... is for placement in the BE, stopped working last week...
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages','tx_zusatzfelder_contentnav_title;;;;1-1-1','','after:subtitle');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages','tx_zusatzfelder_contentnav_title_addition;;;;1-1-1','','after:subtitle');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages','tx_zusatzfelder_contentnav_disable;;;;1-1-1','','after:subtitle');
?>
locallang_db.xml
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3locallang>
<meta type="array">
<type>database</type>
<description>Language labels for database tables/fields belonging to extension 'zusatzfelder'</description>
</meta>
<data type="array">
<languageKey index="default" type="array">
<label index="pages.tx_zusatzfelder_contentnav_title_addition">Untermenu: Vorlauf Titel (zB. "Mehr zur")</label>
<label index="pages.tx_zusatzfelder_contentnav_title">Untermenu: Titellink anderer Text (Standard: Seitentitel; Leerschlag: kein Titel)</label>
<label index="pages.tx_zusatzfelder_contentnav_disable">Untermenu ausblenden</label>
</languageKey>
</data>
</T3locallang>
这就是您添加新字段所需的全部内容——如果您只是喜欢在 ext_tables.php 中执行,您甚至不需要 locallang 'label' => 'My untranslated Label',
。