[Typo3] two questions concerning TMENU

JoH info at cybercraft.de
Wed Oct 5 19:40:31 CEST 2005


>> I am trying to build a TMENU which is made from a table structure
>> like this
>>
>> <tr>
>> <td>menuitem1</td>
>> ...
>> <td>menuitemN</td>
>> </tr>
>>
>> Each table cell has an associated background image which changes
>> from NO to ACT state.
>> The background images are designed to build a panorama, i. e. the
>> background image of the cells
>> together form a larger picture.
>>
>> I have the problem that I need to calculate the name of each
>> background image based on the position
>> in the menu. The first one will be like "bgimage_0.gif", the second
>> "bgimage_1.gif", etc.
>>
>> How can this be done? Currently I have simply a wrap defined with a
>> constant defining the image.
>>
>> Second question: the panorama should be repeating. This means that my
>> panorama contains, say 4 elements.
>> If my menu has more than 4 elements the background images should
>> repeat.
>> As I have them numbered I would expect something like
>> "bgimage_" + (currentPositionInMenu % numberOfImages)
>> (+ concatenation, % the modulo operator)
>> Is this possible?
>
> Seems like a job for optionsplit, although I'm not sure it can rotate
> four image types. Plus my head explodes with examples including more
> than two options. Ask Joey ;)

So here we go ;-)

optionSplit can rotate the wraps for the items.
Everything inside the |*|-markers is repeated and rotated.

allWrap = |*|<td class="1">|</td>||<td class="2">|</td>||<td
class="3">|</td>||<td class="4">|</td>|*|

And then assign the bgimage_x to each class.

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your knob sometimes!)
Dieter Nuhr, German comedian
openBC: http://www.openbc.com/go/invuid/Jo_Hasenau





More information about the TYPO3-english mailing list