---
title: "DynaFlex xml_field in source_config"
url: "https://www.typo3.net/d/112943-dynaflex-xml-field-in-source-config"
source: "typo3.net"
tags: ["Extensions","Entwicklung","Frage"]
created: "2012-11-26"
last_reply: "2012-11-26"
replies: 0
solved: false
page: 1
pages: 1
lang: "de"
---

# DynaFlex xml_field in source_config

Extensions › Entwicklung · 0 Antworten · gestartet 2012-11-26

## Eröffnungsbeitrag

**ohu** · 2012-11-26 · [Beitrag #1](https://www.typo3.net/d/112943-dynaflex-xml-field-in-source-config/1)

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.

```php
'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:

```html
<?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:

```php
'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?

---

Quelle: „DynaFlex xml_field in source_config“, typo3.net, https://www.typo3.net/d/112943-dynaflex-xml-field-in-source-config
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
