[TYPO3-dev] access flexform values in typoscript

Kjeld Schumacher ks at not-only-pixel.de
Tue May 8 13:35:23 CEST 2012


Hi,

it was a mix of ts and PHP code mistakes...
In ts setup:

source.data = DB:tt_content:{field:uid}:pi_flexform
	    source.data.insertData = 1

the "insertData" part was missing so no register value was available, and
in my PHP code I replaced $this->cObj->stdWrap with
$this->cObj->COBJ_ARRAY.

Now everything is working, even if I am unsure about the difference
between COBJ_ARRAY and stdWrap. I have to checkout the documentation on
that two functions.

Thank you for help!!


> Hi Kjeld,
>
> OK, so you do something wrong in your PHP code ;)
>
> The best thing you can do is, to have a look into the extension cobj_xpath
> and cobj_xslt. The do exactly the same thing, mainly defining a new
> content
> object for TS.
>
> But, if I read the tutorial (cobj_xpath) right, you do not need to define
> a
> new content object, because this one is only needed to parse the flexform
> and return something useful out of it.
> You can do this with the mentioned XPATH content object.
>
> Cheers
> Phil
>
> Kjeld Schumacher wrote:
>
>> Yeah my own content object. It is desribed in the article from Steffen
>> Kamper.
>> http://buzz.typo3.org/people/steffen-kamper/article/integrating-own-
> content-elements/
>>
>>> Hi Kjeld,
>>>
>>> Kjeld Schumacher wrote:
>>>
>>>> But as a return value I recieve "XPATH" as a string and not the text
>>>> from
>>>> the flexform.
>>>> Even if I use a simple ts snippet like:
>>>> 20 = NOPOWNCE
>>>>     20 {
>>>>       text = TEXT
>>>>       text.value = foobar
>>>> }
>>>> The result is always TEXT. Did I miss something here?? It looks so
>>>> simple
>>>> in the tutorial...
>>>
>>> What is NOPOWNCE? A new content object?
>
> --
> Philipp Gampe – PGP-Key 0AD96065 – TYPO3 UG Bonn/Köln
> Documentation – linkvalidator
> TYPO3 .... inspiring people to share!
>
> _______________________________________________
> TYPO3-dev mailing list
> TYPO3-dev at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-dev





More information about the TYPO3-dev mailing list