[TYPO3-english] wfqbe - default values for insert forms?

Bernhard Kraft kraftb at kraftb.at
Wed Feb 3 07:12:10 CET 2010


untangler schrieb:

> I use wfqbe to generate forms for new data input into the database. For
> standard it works very well.
> 
> How can I insert some default values, which are to be pre-fetched from a
> database-table, into some fields of a insert form for a new record?

I know no way of fetching default values from some other records. But could
simply set the 'default' value in TCA. You could do this in

typo3conf/extTables.php

By adding a line like:

$GLOBALS['TCA']['tx_yourtable']['columns']['tx_yourfield']['config']['default']='Your-Default';



Another way would be to set TSconfig like:

TCEFORM.tx_yourtable.tx_yourfield.config.default = Your Default Value

But for this to work you would have to add the entry "default" to the
"allowOverrideMatrix" array in t3lib/class.t3lib_tceforms.php, so you
modify the core of TYPO3:

$this->allowOverrideMatrix = array(
  'input' => array('size', 'max'),
  'text' => array('cols', 'rows', 'wrap'),
  'check' => array('cols', 'showIfRTE'),
...

So the line 'input' should look like:

  'input' => array('size', 'max', 'default'),

Which will allow you to set the above TSConfig line (TCEFORM.tx_yourtable...)


greets,
Bernhard


More information about the TYPO3-english mailing list