[TYPO3-english] tt_content.pi_flexform reading, modiying, writing

bernd wilke t3ng at bernd-wilke.net
Tue May 12 11:35:05 CEST 2015


Am 12.05.15 um 11:19 schrieb Jigal van Hemert:
> Hi,
>
> On 12/05/2015 09:51, bernd wilke wrote:
>> due to development we have a lot of content elements (CE) with an
>> out-of-date structure in the pi_flexform.
>> I have to update the data to the current datastructure, but have no clue
>> how to read, modify and write back the structure in
>> tt_content.pi_flexform.
>>
>> I found a lot of tips, but every combination of functions I use:
>> I never get back the same XML-structure.
>>
>> here is an example for the nearest. the endresult has nearly the same
>> number of nodes on each level, but the tags have very differnt names and
>> attributes:
>>
>> $decodeFlexFormArray =
>> \TYPO3\CMS\Core\Utility\GeneralUtility::xml2array($record['pi_flexform']);
>>
>
> That's a good start. If you look at the flexform definition the "index"
> attributes define the tag name in the resulting array (numeric "index"
> attribute value indicates that it's a repeated block with numeric array
> keys)
>
> After you change the array you can simply let DataHandler (aka TCEmain)
> take care of storing it again. No need to transform it back to XML at all!
>

There is a way to store arrays as xml to tt_content.pi_flexform?

is there any documentation to this?


bernd
-- 
http://www.pi-phi.de/cheatsheet.html


More information about the TYPO3-english mailing list