Zum Inhalt springen

DynaFlex xml_field in source_config

Erstellt am 26. November 2012 · Noch keine Antworten

Tags: Frage

ohu ·

Hallo Forum

Ich möchte mit dynaflex ein XML-Feld aus pi_flexform im tt_content auslesen und daraus weitere Felder mit dynaflex erstellen.
Das XML-Feld wird auch von dynaflex erstellt und heisst item_count wie unten zu sehen ist.

'modifications' => array (
	array (
		'method' => 'add',
		'path' => 'ROOT/el',
		'type' => 'field',
		'label' => 'Vergleich',
		'name' => 'comparison_text',
		'config' => array (
			'type' => 'input'
		)
	),
	array (
		'method' => 'add',
		'path' => 'ROOT/el',
		'type' => 'field',
		'label' => 'Anzahl',
		'name' => 'item_amount',
		'config' => array (
			'type' => 'input',
			'size' => 5
		)
		
	),
	array (
		'method' => 'add',
		'path' => 'ROOT/el',
		'type' => 'fields',
		'source' => 'field',
		'source_type' => 'int',
		'source_config' => array (
			'table' => 'tt_content',
			'db_field' => 'pi_flexform',
			'path' => 'sDEF/lDEF',
			'xml_field' => 'item_count'
		),
		'field_config' => array (
			'name' => 'product',
			'label' => 'Produktbeschreibung',
			'config' => array (
				'type' => 'input'
			)
		)
	)
)

item_count hat den Wert '2'.
So siehts im pi_flexform aus:

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3FlexForms>
    <data>
        <sheet index="sDEF">
            <language index="lDEF">
                <field index="item_amount">
                    <value index="vDEF">2</value>
                </field>
                <field index="comparison_text">
                    <value index="vDEF"></value>
                </field>
            </language>
        </sheet>
    </data>
</T3FlexForms>

So müsste es mir doch 2 weitere Felder generieren, was aber nicht getan wird.
Wenn ich xml_field entferne, erstellt es mir ein neues Feld. Aber nur eines. Ich gehe davon aus, dass es dann einfach erkennt, dass überhaupt was im pi_flexform drin steht und mir ein Feld erstellt.

So gehts ausserdem auch nicht:

'source_config' => array (
	'table' => 'tt_content',
	'db_field' => 'pi_flexform',
	'path' => 'sDEF/lDEF/item_count',
	'xml_field' => 'vDEF'
),

Hat irgendwer ne Idee oder weiss gerade was noch fehlt oder falsch ist?