[TYPO3] How to make a mandatory field

Tapio Markula tapio.markula at dnainternet.net
Fri Jul 28 12:33:57 CEST 2006

webmaster (Ayto.Chiclana) wrote:
> hi all.
> In a content type text with image, how to make mandatory the field "alt
> text"???
> I think the field in the database is
> tt_content.tx_croncssstyledimgtext_altText.
> Thaks all.

You must create a small extension for that because
you add a condition.


$tempColumns = Array (
		'header_position' => Array (
		  'exclude' => 1,		
			'label' => 'LLL:EXT:cms/locallang_ttc.php:header_position',
			'config' => Array (
				'type' => 'select',
				'items' => Array (
					Array('', ''),
					Array('LLL:EXT:cms/locallang_ttc.php:header_position.I.1', 'center'),
					Array('LLL:EXT:cms/locallang_ttc.php:header_position.I.2', 'right'),
					Array('LLL:EXT:cms/locallang_ttc.php:header_position.I.3', 'left')
				'default' => ''


note that those *override* all existing setting, which has been set for
certain field - might cause problems!


t3lib_div::loadTCA("tt_content"); // that loads all existing setting

the latter just overwrites *individual* values.
Adding new conditions should work too (I have not newer set at this way).

Recommendation. Make as small user_setting plugin, where you
collect all you modifications and set for it
into ext_emconf.php 'priority' => 'bottom',

More information about the TYPO3-english mailing list