[Typo3] creating a basic extension : how can i add a select/option form element in the BE/plugin

Jochen Rieger j.rieger at connecta.ag
Mon Dec 5 12:15:50 CET 2005


Hi typo3-ml (interesting name btw ;) ),

I think tca.php is your friend.

Something like this:

"yourDbField" => Array (		
    "exclude" => 1,		
    "label" => 
"LLL:EXT:yourExtension/locallang_db.php:tx_yourExtension.yourLocalLangLabel", 
	
    "config" => Array (
       "type" => "select",
       "items" => Array (
 
Array("LLL:EXT:yourExtension/locallang_db.php:tx_yourExtension.yourLocalLangLabel.option.0", 
"value1"),
 
Array("LLL:EXT:yourExtension/locallang_db.php:tx_yourExtension.yourLocalLangLabel.option.1", 
"value2"),
 
Array("LLL:EXT:yourExtension/locallang_db.php:tx_yourExtension.yourLocalLangLabel.option.2", 
"value3"),
       ),
    "size" => 1,	
    "maxitems" => 1,
    )
),

--------

of cause you can also fill in hard coded labels insteand of using your 
locallang_db.php

Hope that'll help.

Not to forget that also you have to have your fields configured in 
ext_tables.sql and if needed ext_tables.php.

Cheers,
Jochen

typo3-ml at w3tex.com wrote:
> Hi,
> 
> I  just followed the "creating a basic extension" PDF tutorial.
> 
> everything works OK.
> 
> 
> now I need to add in the Back end / plugin form
> a <SELECT> form element
> using selectable items provided by a database query.
> 
> something like this
> <select name="categories">
>     <option value="1">skate</option>
>     <option value="1">bike</option>
>     ...
> </select>
> 
> which file should I modify to add this form element in the BE/plugin ?
> 
> 
> please help ! thanks !!
> 
> 

-- 
:: innovative it-strategies ::
::                          ::
:: www.connecta.ag          ::



More information about the TYPO3-english mailing list