[TYPO3-english] TYPO3 TS userlisting: using AVG, SUM etc in select

Christian Hennecke ch at moon-agentur.de
Fri Dec 6 12:00:03 CET 2013


Am 06.12.13 11:47, schrieb Bert Hiddink [BENDOO e-work solutions]:
> Hello Christian,
>
> Thanks for your reply...
>
> On 06-12-13 11:32, Christian Hennecke wrote:
>
>> [snip]
>>
>> You could make lib.userlisting a COA and add another CONTENT object with
>>
>> selectFields = type, SUM(tx_feuserextrafields_donation)
>
> OK but how should I render this part in order to show the total?
>
>   renderObj=COA
>    renderObj{
>
>      #Show total here of field tx_feuserextrafields_donation
>      10=TEXT
>      10.field=tx_feuserextrafields_donation ####?????
>      10.wrap =<td>|</td>
> ....

Ah, sorry. You need to assign a new field name with AS:

selectFields = type, SUM(tx_feuserextrafields_donation) AS total_donation

and then

renderObj=COA
renderObj{
   #Show total here of field tx_feuserextrafields_donation
   10=TEXT
   10.field= total_donation
   10.wrap =<td>|</td>



More information about the TYPO3-english mailing list