Task #51008
closedAdditional Register values in FilesContentObject
0%
Description
FILE_NUM_CURRENT starts with 0. A TypoScript snippet like this would be required to render the last file special:
30 = TEXT 30.value = Yay, 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
In this case it would be wonderful to have an additional register value "FILE_IS_LAST":
30 = TEXT 30.value = Yay, last file! 30.if.isTrue.data = register:FILE_IS_LASTAnd there are 4 additional useful register values:
- FILE_IS_FIRST: Solves the question if number "1" or "0" is the first one
- FILE_IS_ODD
- FILE_IS_EVEN
- FILE_CYCLE: Current number starting with 1
Updated by Gerrit Code Review over 10 years ago
- Status changed from New to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23027
Updated by Lars Malach over 10 years ago
Its related to http://forge.typo3.org/issues/49480
Updated by Stefan Reichelt over 10 years ago
Thanks for continuing this, Lars!
A few questions:
1. Isn't there any other way to store the variables other than the register?
I think two variables should be fine, but more feels like overusing the registers purpose.
Something like 'file:current:isFirst' would be neat if possible, but from the little I know that might be too much hassle for such a feature...
2. If the register is best (or only) way, could you unset the variables in it again once all files were rendered? Imho, this would be more in line with the idea of leaving it behind how you've found it. Like RESTORE_REGISTER I guess.
3. Out of curiousity: Do you plan to do more with IterationStateUtility? I could imagine a few more usecases for it. It looks quite neat but seems a little overkill if meant only for this feature.
Cheers!
Updated by Wouter Wolters over 9 years ago
- Status changed from Under Review to Closed
Lars Malach Oct 8, 2013
Abandoned
IterationStateUtility Class is to much for this purpose. All of it is already possible with the optionSplit.