[TYPO3-english] Passing a value from TS to userfunc for SQL: value={field:uid} [SOLVED}

Bert Hiddink [BENDOO e-work solutions] hiddink at bendoo.nl
Wed Dec 3 08:14:09 CET 2014


Hello Bernd,

Finally, I solved the issue by changing from "userFunc" to 
"postUserFunc" as the latter passes the TS at a later stage I suppose.

Then:

           35=TEXT
           35 {
             field = uid
             postUserFunc = user_counter->getCounter
             postUserFunc.field = uid
             postUserFunc.selectedPid=38
             postUserFunc.getCategories=TEXT
             postUserFunc.getCategories.data = 
GP:tx_news_pi1|overwriteDemand|categories
           }

and then within the function:
...
<?php
class user_counter {
   function getCounter($content = '', $conf = array()) {
     $catUid = $this->cObj->data['uid'];
...

So that works great now!

The only thing I could not get to work is how to receive other 
TS-objects within the function like

postUserFunc.getCategories=TEXT
postUserFunc.getCategories.data = GP:tx_news_pi1|overwriteDemand|categories

Within the function I have:

    $selectedPid=$conf['selectedPid']; //This works
     // config
     global $TSFE;
     $local_cObj = $TSFE->cObj; // cObject
     $conf = $conf['postUserFunc.']; // ts config

I tried with:
$selectedCategories=$local_cObj->cObjGetSingle($conf['selectedCategories'], 
$conf['selectedCategories.']);

...but this did not return anything...Any idea?

Thanks again!!!!

Regards,
Bert


On 02-12-14 16:52, bernd wilke wrote:
> Am 02.12.14 16:14, schrieb Bert Hiddink [BENDOO e-work solutions]:
>> Hello Bernd,
>>
>> If I change....
>>
>>            35 = USER
>>            35 {
>>              userFunc = user_counter->getCounter
>>              userFunc {
>>                # whole string
>>                selectedCategories=TEXT
>> selectedCategories.data=GP:tx_news_pi1|overwriteDemand|categories
>>                selectedUid=TEXT
>>                selectedUid.value={field:uid}
>>                selectedPid={$categoriesPid}
>>              }
>>            }
>>
>> And that is not what I want, I need the uid of the current category...



> have you tried
> selectedUid.field = uid
> ?
>
> other approach:
> try to rename the uid from sys_categories to an unique name.
> 30.select.selectFields = uid as CatUid,...
>
> bernd
>



More information about the TYPO3-english mailing list