[TYPO3-english] Iterations with TS

Mikel lists at wohlschlegel.org
Wed Dec 14 17:37:02 CET 2011


Hi Christian,

thanks for your respond. I tried until I found out that it is better to 
rewrite the JavaScript code. So no need to do it with TS.

Thanks anyway.

Mikel
> Hi Mikel.
>
> Depending on what you want to achieve there are multiple options.
>
> I guess the code you posted is used inside a LOAD_REGISTER, right? But 
> where do you get your data from? A CONTENT object?
> In this case you could do something like
>
> 10 = LOAD_REGISTER
> 10.counter = 100
>
> 20 = CONTENT
> 20 {
>     # ...
>     renderObj = COA
>     renderObj {
>         10 = LOAD_REGISTER
>         10.counter {
>             # ...
>         }
>         20 = TEXT
>         # ...
>     }
> }
>
> 30 = RESTORE_REGISTER
>
> But the great disadvantage here is that each LOAD_REGISTER should be 
> matched by one RESTORE_REGISTER and you had to do some really ugly 
> coding to get this working here. In the worst case this could fall 
> back on you later on, so I don't recommend this.
>
> So I've got two more recommendations:
>
> 1. Use a userFunc. If you know some PHP just write a simple static PHP 
> class that does the counting and fetch the value through preUserFunc.
>
> 2. Use split 
> (http://typo3.org/documentation/document-library/core-documentation/doc_core_tsref/4.6.0/view/1/5/#id2621952). 
> As you have fixed values this could actually work, but it depends on 
> what you are trying to do.
>
> Christian.
>


More information about the TYPO3-english mailing list