[TYPO3-english] question about function numRows from Typoscript

Jigal van Hemert jigal.van.hemert at typo3.org
Tue Apr 7 10:00:22 CEST 2015


Hi,

On 06/04/2015 16:09, Yordan Ivanov wrote:
> Hi List,
> I want to count number of records that have a certain email,
> I have tired the following snippet, but no output. I have modified an example that is working
> here is the snippet:
>
> lib.test = COA
> lib.test {
>    10 = LOAD_REGISTER
>    10.menuNumber.numRows {
>      table = tx_testformata_domain_model_formata
>     select.pidInList = 0

This is your first challenge. pidInList cannot be zero; in TYPO3 6.2 and 
later you can use pidInList = root to read records from pid=0

>     #select records with a certain email
>      select.where = email=example at gmail.com
>    }
>
>    20 = TEXT
>    20.dataWrap = <div>There are {register:menuNumber} records</div>
> }
>

The whole register handling is not really needed if you just want to 
show the result.
lib.test = TEXT
lib.test {
   numRows {
     table = tx_testformata_domain_model_formata
     select.pidInList = root
     select.where = email=example at gmail.com
   }
   wrap = <div>There are | records</div>
}

should do the trick (untested).

-- 
Jigal van Hemert
TYPO3 CMS Active Contributor

TYPO3 .... inspiring people to share!
Get involved: typo3.org


More information about the TYPO3-english mailing list