[Typo3] dynaflex : how to add a simple field
Thomas Hempel
thomas at work.de
Tue Oct 4 13:13:37 CEST 2005
Hi,
to edit mm tables you can't use dynaflex because a mm table has no
corresponding TCE form!?
To insert additional data into an mm table, you have to do this with a
hook in the TCE main class. An example could be:
if ($table == 'tx_commerce_articles') {
// update article attribute relations
if (isset($incomingFieldArray['attributesEdit'])) {
// get the data from the flexForm
$attributes =
$incomingFieldArray['attributesEdit']['data']['sDEF']['lDEF'];
foreach ($attributes as $aKey => $aValue) {
$aUid = $this->belib->getUidFromKey($aKey, $keyData);
// update article attribute relation
$GLOBALS['TYPO3_DB']->exec_UPDATEquery(
'tx_commerce_articles_article_attributes_mm',
'uid_local=' .$id .' AND ' .'uid_foreign=' .$aUid,
array('uid_valuelist' => $aValue['vDEF'])
);
}
}
The hook is "processDatamap_preProcessFieldArray".
THIS IS JUST An EXAMPLE. Simply copied from commerce. Hope it helps anyway.
Greets,
Thomas
--
typo3-unleashed.net
More information about the TYPO3-english
mailing list