[TYPO3] Is there something like insertData in postUserFunc?
Joerg Wagner
news.netfielders.de at digilog.de
Mon Sep 22 12:12:10 CEST 2008
Dmitry Dulepov schrieb:
> $this->cObj->getData($conf['uid'], null);
I had a similar problem where the above solution did not work. Just in
case somebody is interested...
The getData method seems not to work for field data originating from TV
FCEs.
E.g. if you have an FCE with a select type data element with field name
'field_myselect' and you want to access the item that the user has
chosen from all the select items in a TypoScriptObjPath (e.g.
'lib.myTSobj'), then this works in TS:
lib.myTSobj = TEXT
lib.myTSobj.field = field_myselect
But this does NOT work in a postUserFunc PHP method:
$this->cObj->getData('field_myselect', null);
This works instead:
$this->cObj->data['field_myselect'];
Hint:
To easily find where in $this->cObj your desired data is hidden, just
place this in your PHP postUserFunc method for a quick test and search
for your data in the source code of the generated page:
var_dump($this->cObj);
exit;
Cheers,
Jörg.
Dmitry Dulepov schrieb:
> Benjamin Harwell wrote:
>> Creating a subject that relates to what you are trying to do is always
>> difficult.. The small code snippet below is from a TMENU I'm working
>> on. I
>> need to replace the "field:uid" with the uid of the subpage currently
>> being
>> processed. My question is, how in the world do you get that to
>> substitute?
>>
>> NO {
>> doNotShowLink = 1
>> before.cObject = COA
>> before.cObject {
>> 1 = TEXT
>> 1.postUserFunc = user_doStuff->getContentFlexValue
>> 1.postUserFunc{
>> uid = field:uid
>> }
>> }
>> }
>
> Inside your userFunc:
>
> $this->cObj->getData($conf['uid'], null);
>
More information about the TYPO3-english
mailing list