[TYPO3] TS TMenu and register:count_HMENU_MENUOBJ

Patrick Pirrotte Patrick.Pirrotte at lns.etat.lu
Thu May 17 10:06:41 CEST 2007


Dear List,

I'm currently stuck with a TMENU for which I have found no solution yet besides writing up a PHP userfunction, something I would like to avoid as my goal is to learn typoscript.

I'd like to have a topmenu composed of multicoloured tabs, with an area below the tabs coloured corresponding to the selected menu.

Below is the TS I have so far. It shows multicoloured tabs by using {register:menuCounter}. This works perfectly fine inside a TMENUITEM (like NO or ACT).
Unfortunately, in lib.menutop.1.stdWrap.dataWrap, the register:count_HMENU_MENUOBJ always returns the last value and not the value count of the active item?

I suppose there should be a way to have an internal counter for the value, but I haven't found out how to make those registers work yet.

I'm glad for any help and hints I can get.

Best regards,

Patrick 

lib.menutop = HMENU
# First level menu-object, textual
 
#lib.menutop.entryLevel = 0
lib.menutop.1 = TMENU
lib.menutop.1 {
    stdWrap.dataWrap(
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
  <tr>
    <td align="left" valign="top" background="images/navi/{register:count_HMENU_MENUOBJ}_bg.gif"><table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
      <tr>
        <td><img src="images/spacer.gif" width="5" height="1"></td> | <td width="100%"><img src="images/spacer.gif" width="1" height="1"></td>
          </tr>
        </table></td>
      </tr>
    </table>
    )
    NO{
         allWrap.cObject = TEXT
         allWrap.cObject.value = |
         allWrap.dataWrap(
                 <td width="6"><img src="images/navi/{register:count_HMENU_MENUOBJ}_left.gif"></td>
            <td background="images/navi/{register:count_HMENU_MENUOBJ}_middle.gif" class="topmenu{register:count_HMENU_MENUOBJ}" align="left" valign="top" nowrap>
              <img src="images/spacer.gif" width="1" height="3"><br><span class="topmenu{register:count_HMENU_MENUOBJ}">|</span></td><td width="6"><img src="images/navi/{register:count_HMENU_MENUOBJ}_right.gif"></td><td><img src="images/spacer.gif" width="5" height="1"></td>
             )
         ATagParams.dataWrap = class="topmenu{register:count_HMENU_MENUOBJ}"
             {register:menuCounter} = {register:count_HMENU_MENUOBJ}
           stdWrap.htmlSpecialChars = 1
        }
        ACT = 1
        ACT{
         allWrap.cObject = TEXT
         allWrap.cObject.value = |
         allWrap.dataWrap(
                 <td width="6" valign="top"><img src="images/navi_inactive/{register:count_HMENU_MENUOBJ}_left.gif"></td>
            <td background="images/navi_inactive/{register:count_HMENU_MENUOBJ}_middle.gif" class="main_navi" style="background-repeat: repeat-x;" align="left" valign="top" nowrap>
              <img src="images/spacer.gif" width="1" height="3"><br> <span class="topmenu{register:count_HMENU_MENUOBJ}">|</span></td>
            <td width="6" valign="top"><img src="images/navi_inactive/{register:count_HMENU_MENUOBJ}_right.gif"></td><td><img src="images/spacer.gif" width="5" height="1"></td>
             )
         ATagParams.dataWrap = class="topmenu{register:count_HMENU_MENUOBJ}"
            
           stdWrap.htmlSpecialChars = 1
        }
  
}   




More information about the TYPO3-english mailing list