[Typo3-UG France] Typoscript & Menu & Variables

Francois Suter fsuter at cobweb.ch
Tue Sep 27 12:03:42 CEST 2005


Salut,

> Ma question est comment je pourrais définir une variable en TS et comment
> l’incrémenter ?

Le script suivant a récemment circulé sur la liste anglaise:

-- cut --
You can create a counter using LOAD_REGISTER.

Here's an example that is based on your TS code..

temp.swfgetvars = COA
temp.swfgetvars {
   20 = CONTENT
   20 {
     table = pages
     select {
       pidInList = this
       selectFields = uid,title
     }
     renderObj = COA
     renderObj {
       # Here we increment our register var "myCounter"
       10 = LOAD_REGISTER
       10.myCounter.cObject = TEXT
       10.myCounter.cObject.data = register:myCounter
       10.myCounter.cObject.wrap = |+1
       10.myCounter.prioriCalc = intval

       # This generates the output, using the "myCounter" counter
       20 = TEXT
       20.insertData = 1
       20.value = 
uid{register:myCounter}={field:uid}&title{register:myCounter}={field:title}&
     }
   }
   # Remove the last trailing "&" sign.
   stdWrap.substring = 0,-1
}

page.911 < temp.swfgetvars
-- /cut --

Peut-être cela pourra-t-il t'aider. Je n'ai pas essayé.

-- 

Francois Suter
Cobweb Development Sarl - http://www.cobweb.ch



More information about the TYPO3-france mailing list