[TYPO3] Split menu with variable number of items in half

Peter Klein peter at umloud.dk
Tue Mar 28 11:35:18 CEST 2006


Hi Jan. I was wrong earlier, as "register:count_HMENU_MENUOBJ" do get reset 
for every menu.
I think the problem is a rounding error, so try this one..

-- cut --
lib.splitmenu = COA
lib.splitmenu {

  10 = HMENU
  10.special = directory
  10.special.value = 1
  10.1 = TMENU
  10.1 {
    wrap = <div>1st half of menu items<br>|</div>
    NO {
      stdWrap.cObject = COA
      stdWrap.cObject {
        10 = TEXT
        10.field = title
        if.value.data = register:count_HMENU_MENUOBJ
        if.negate = 1
        if.isLessThan.prioriCalc=1
        if.isLessThan.cObject=TEXT
        if.isLessThan.cObject.insertData=1
        if.isLessThan.cObject.value = ({register:count_menuItems}+1)/2
        wrap = |<br>
      }
    }
  }
  20 < .10
  20.1.wrap = <div>2nd half of menu items<br>|</div>
  20.1.NO.stdWrap.cObject.if.negate >
}

page.200 < lib.splitmenu
-- cut --

Let me know if it works for you..

-- 
Peter Klein/Umloud Untd

"Jan Slusarczyk" <janslu at grupaiis.pl> skrev i en meddelelse 
news:mailman.1.1143534444.28372.typo3-english at lists.netfielders.de...
> Hi Peter
>
>> Hi Jan. That's because the value of "register:count_HMENU_MENUOBJ" 
>> doesn't get reset for every menu, but rather gets increased for each 
>> menuitem displayed on the page.
>> So my guess is that you have some other menu on your page, BEFORE this 
>> one (Maybe a language menu?)
>
> I have a breadcrumb menu rendered first (homepage / sub1 / ...)!
> So again - a variable number...
>
>> Here's an updated version of the code I posted yesterday, which should 
>> work no matter if theres other menus before it on the page.
>> Let me know if it works..
>
> Unfortunately it doesn't work... All items are in first part of menu - the 
> second part is always empty... I tried it also on a page with 35 links...
>
> Thanks
>
> Jan 





More information about the TYPO3-english mailing list