[TYPO3-english] FILES cObject, get total number of its retrieved files

Stefan Reichelt eichelt at web.de
Wed Aug 7 17:56:33 CEST 2013


On 06/08/2013 21:34, Wouter Wolters wrote:
> Hi Stefan,
> 
> Are you maybe looking for this pending feature [1]?
> 
> Wouter
> 
> [1] https://review.typo3.org/#/c/21747/

Yes, exactly what I hoped for. You guys are awesome, thanks!


One question about the change though (although I guess I should probably
ask it in the issue?):
Is it intended that FILE_NUM_CURRENT/$fileObjectCounter starts with 0
and/or is only increased after the file has been rendered?

The problem I see with it is that by the time we reach the last file the
object is rendering, FILE_NUM_CURRENT will be still one short of
FILES_COUNT and with the TS example (renderObj.20.value) given in the
change it would output 'file 6 of 7' (if you have 7 files in total that is).

This could lead to confusion and also makes it harder to use in
TypoScript, fe. if you wanted to check if you've reached the last file:
--
30 = TEXT
30.value = Last file!
30.if.equals.data = register:FILE_NUM_CURRENT
30.if.value.data = register:FILES_COUNT
30.if.value.stdWrap.wrap = |-1
30.if.value.prioriCalc = 1
--

Unless of course there is an easier way to do it?


Thanks again and
kind regards
Stefan


More information about the TYPO3-english mailing list