[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" 
onmouseover="this.className='button_yellow_over'" 
onmouseout="this.className='button_yellow'"> || <p class="button_green" 
onmouseover="this.className='button_green_over'" 
onmouseout="this.className='button_green'"> || <p class="button_blue" 
onmouseover="this.className='button_blue_over'" 
onmouseout="this.className='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
www.cobweb.ch
-----------------------------------------------------



More information about the TYPO3-english mailing list