[TYPO3] Using count_menuItems to split a menu in two parts

JoH asenau info at cybercraft.de
Wed Jan 24 02:03:40 CET 2007


>>> The last two menu items have to be dealt with specially and they
>>> are always there.  I wanted to create two menu objects and render
>>> them apart.  The second part will always have two items and the
>>> first part could have one or many.
>>>
>>> I tried to isolate them by using begin, maxItems and minItems but I
>>> think I'm not getting count_menuItems right.
>
> Thanks for the tips on TS.  Sometimes it's hard to understand it.
>
>> What exactly are you trying to do? Why do you /need/ to count the
>> menu items? Tapio might be right about optionSplit being a more
>> efficient option, or something like this may work for you:
>
> I'm already using optionSplit, but I have this menuitems in different
> pages:
>
> one|two|three|red|white
>
> six|seven|eight|nine|red|white
>
> I wanted to have all menu items but the last two (red and white) so
> that
> I could deal with them easier.  There is an image in between and it's
> a long long optionSplit to get that working.  The only way I could
> find to isolate the last two, besides optionSplit, was maxItems.
>
> I thought it'd be easier to have two menus and deal with each one.

Did you know that optionSplit can be used with any property inside an item
state like NO, CUR, ACT and the like?

So try to setup the two separate menus as you descriebd and use these
optionSplits:

for the first menu

doNotShowLink = |*| 0 |*| 1 || 1

for the second menu

doNotShowLink = |*| 1 |*| 0 || 0

Another option could be to use some PHP array functions, since you are
already using itemArrayProcFunc. Again you can use two separate menus and
simply cut off the entries you don't want.

HTH

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your gob sometimes!)
Dieter Nuhr, German comedian
openBC/Xing: http://www.cybercraft.de
T3 cookbook: http://www.typo3experts.com




More information about the TYPO3-english mailing list