[Typo3] Optimisation of Typoscript

Francois Suter fsuter at cobweb.ch
Fri Jun 3 16:43:20 CEST 2005

Hi all,

I have the following TypoScript:

lib.header = HMENU
lib.header {
   special = directory
   special.value = 833
   1 = TMENU
   1 {
     NO.before = |*|<p class="button_yellow" 
onmouseout="this.className='button_yellow'"> || <p class="button_green" 
onmouseout="this.className='button_green'"> || <p class="button_blue" 
     NO.after = </p>
     NO.stdWrap.htmlSpecialChars = 1

which takes a directory and makes a menu out of it. Three paragraph 
styles are rotated to render the menu elements. Each paragraph has 
javascript calls for changing the styles when the menu item is rolled 
over. This works fine and, yes, I know it could (or maybe should) be 
done with a GMENU rather than a TMENU. I like this solution because my 
client can edit just the CSS stylesheet.

My question is how can I make this script more readable? I would like 
to have something like:

style = |*| button_yellow || button_green || button_blue |*|

and then insert this value into my <p class="... etc. rather than 
repeat the whole code every time.

Is this feasible?

Thanks for any advice.

François Suter
Directeur technique
Cobweb Development Sàrl

More information about the TYPO3-english mailing list