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

Bert Hiddink [BENDOO e-work solutions] hiddink at bendoo.nl
Tue Dec 2 16:14:35 CET 2014


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}
             }
           }

...for...
           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}
               selectedUid.insertData=1
               selectedPid={$categoriesPid}
             }
           }

...selectedUid.value prints the uid of the current page instead of the 
current category which comes from an content-object:
...
      30 = CONTENT
       30 {
         stdWrap {
           required = 1
           wrap = <div class="filterinhoud filter{field:uid}">|</div>
           insertData=1
         }
         table = sys_category
         select {
           pidInList = {$categoriesPid}
           orderBy = sorting
           where=deleted=0 AND hidden=0
           andWhere.dataWrap = sys_language_uid={TSFE:sys_language_uid} 
AND parent={field:{$languageField}}
         }
         renderObj = COA
         renderObj {
...

And that is not what I want, I need the uid of the current category...

Thanks again for any pointer!
Regards,
Bert

On 02-12-14 15:59, bernd wilke wrote:
> Am 02.12.14 15:07, schrieb Bert Hiddink [BENDOO e-work solutions]:
>> Hello,
>>
>> Having a hard time understanding why I can not pass a value with
>> value:{field:uid} to a SQL-statement within a userfunc.
>>
>> Please see below. If I hardcode "selectedUid.value=654", the SQL gives
>> the expected result. However, if I use "selectedUid.value={field:uid}",
>> the SQL returns nothing, not even 0, that is, makes the statement
>> invalid IMHO.
>
> either you need to do the stdwrap/ evaluate your TS yourself
> or you just missed to use .insertData = 1
>
> bernd



More information about the TYPO3-english mailing list