rtgx

TCA

Verzia: 4.6.0

Typ "input"

jednoduchý text

$TCA['tt_content'] = array(
'columns' => array(
'header' => array(
'l10n_mode' => 'prefixLangTitle',
'l10n_cat' => 'text',
'label' => 'LLL:EXT:cms/locallang_ttc.xml:header',
'config' => array(
'type' => 'input',
'size' => '50',
'max' => '256',
'eval' => 'trim',
),
),
),
);

dátum

$TCA['tt_content'] = array(
'columns' => array(
'date' => array(
'exclude' => 1,
'label' => 'LLL:EXT:cms/locallang_ttc.xml:date',
'config' => array(
'type' => 'input',
'size' => '13',
'max' => '20',
'eval' => 'date',
'default' => '0',
),
),
),
);

eval: možné hodnoty

  • required: A non-empty value is required in the field (otherwise the form cannot be saved).
  • trim: The value in the field will have white spaces around it trimmed away.
  • date: The field will evaluate the input as a date, automatically converting the input to a UNIX-time in seconds. The display will be like "12-8-2003" while the database value stored will be "1060639200".
  • datetime: The field will evaluate the input as a date with time (detailed to hours and minutes), automatically converting the input to a UNIX-time in seconds. The display will be like "16:32 12-8-2003" while the database value will be "1060698720".
  • time: The field will evaluate the input as a timestamp in seconds for the current day (with a precision of minutes). The display will be like "23:45" while the database will be "85500".
  • timesec: The field will evaluate the input as a timestamp in seconds for the current day (with a precision of seconds). The display will be like "23:45:13" while the database will be "85513".
  • year: Evaluates the input to a year between 1970 and 2038. If you need any year, then use "int" evaluation instead.
  • int: Evaluates the input to an integer.
  • upper: Converts to uppercase (only A-Z plus a selected set of Western European special chars).
  • lower: Converts the string to lowercase (only A-Z plus a selected set of Western European special chars).
  • alpha: Allows only a-zA-Z characters.
  • num: Allows only 0-9 characters in the field.
  • alphanum: Same as "alpha" but allows also "0-9"
  • alphanum_x: Same as "alphanum" but allows also "_" and "-" chars.
  • nospace: Removes all occurrences of space characters (chr(32))
  • md5: Will convert the inputted value to the md5-hash of it (The JavaScript MD5() function is found in typo3/md5.js)
  • is_in: Will filter out any character in the input string which is not found in the string entered in the key "is_in" (see below).
  • password: Will show "*******" in the field after entering the value and moving to another field. Thus passwords can be protected from display in the field. Notice that the value during entering it is visible!
  • double2: Converts the input to a floating point with 2 decimal positions, using the "." (period) as the decimal delimited (accepts also "," for the same).
  • unique: Requires the field to be unique for the whole table. (Evaluated on the server only). NOTICE: When selecting on unique-fields, make sure to select using “AND pid>=0” since the field CAN contain duplicate values in other versions of records (always having PID = -1). This also means that if you are using versioning on a table where the unique-feature is used you cannot set the field to be truly unique in the database either!
  • uniqueInPid: Requires the field to be unique for the current PID (among other records on the same page). (Evaluated on the server only)
  • tx_*: User defined form evaluations. See below.

Typ "text"

$TCA['tt_content'] = array(
'columns' => array(
'altText' => array(
'exclude' => 1,
'label' => 'LLL:EXT:cms/locallang_ttc.xml:image_altText',
'config' => array(
'type' => 'text',
'cols' => '30',
'rows' => '3',
),
),
),
);

Typ "check"

$TCA['tt_content'] = array(
'columns' => array(
'hidden' => array(
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.hidden',
'config' => array(
'type' => 'check',
'items' => array (
'1' => array( '0' => 'LLL:EXT:cms/locallang_ttc.xml:hidden.I.0', ),
),
),
),
),
);

Typ "select"

$TCA['tt_content'] = array(
'columns' => array(
'date' => array(
'label' => 'LLL:EXT:cms/locallang_ttc.xml:header_position',
'exclude' => 1,
'config' => array(
'type' => 'select',
'items' => array(
array( 'LLL:EXT:lang/locallang_general.xml:LGL.default_value', '', ),
array( 'LLL:EXT:cms/locallang_ttc.xml:header_position.I.1', 'center', ),
array( 'LLL:EXT:cms/locallang_ttc.xml:header_position.I.2', 'right', ),
array( 'LLL:EXT:cms/locallang_ttc.xml:header_position.I.3', 'left', ),
),
'default' => '',
),
),
),
);
$TCA['tt_content'] = array(
'columns' => array(
'l18n_parent' => array(
'displayCond' => 'FIELD:sys_language_uid:>:0',
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.l18n_parent',
'config' => array(
'type' => 'select',
'items' => array(
array( '', 0, ),
),
'foreign_table' => 'tt_content',
'foreign_table_where' => 'AND tt_content.pid=###CURRENT_PID### AND tt_content.sys_language_uid IN (-1,0)',
),
),
),
);

Typ "group"

$TCA['tt_content'] = array(
'columns' => array(
'image' => array(
'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.images',
'config' => array(
'type' => 'group',
'internal_type' => 'file',
'allowed' => $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'],
'max_size' => $GLOBALS['TYPO3_CONF_VARS']['BE']['maxFileSize'],
'uploadfolder' => 'uploads/pics',
'show_thumbs' => '1',
'size' => '3',
'maxitems' => '200',
'minitems' => '0',
'autoSizeMax' => 40,
),
),
),
);
 
Žiadne dokumenty ani odkazy k tejto stránke.

Generátor typoscriptu

Vytvára typoscript pre bežné použitie. Generátor je jednoduchý na obsluhu, stačí vyplniť zopár položiek formulára.

Odkazy