title: Counting Menu Items of the SubMenu in Typo3
body: <p>I'm currently trying to create a nav in Typo3, and I need to know the number of items in the submenu of the current menu. But i don't see any possibity in achieving this.</p>
  
  <p>I know about {register:count_menuItems}, but this doesn't really help.</p>
  
  <p>In the first level of the nav I need the number of Items of the second level to put it into the class of the list (4 in this example)</p>
  
  <pre><code>wrapItemAndSub = &lt;li class="dropdown mega-menu-4"&gt; | &lt;/li&gt;
  </code></pre>
  
  <p>Is it even worth trying or simply not possible?</p>
  
  <p>Thanks :)</p>
  
  <p>Example of the Nav:</p>
  
  <pre><code>#Testmenu4
  lib.testmenu4 = HMENU
  lib.testmenu4 {
  entryLevel = 0
  
  1 = TMENU
  1 {
      expAll = 1
      wrap = &lt;ul class="nav navbar-nav"&gt; | &lt;/ul&gt;
      noBlur = 1
  
      NO = 1
      NO {
          wrapItemAndSub = &lt;li&gt; | &lt;/li&gt;
          stdWrap.htmlSpecialChars = 1
          ATagTitle.field = title
      }
  
      IFSUB = 1
      IFSUB {
          wrapItemAndSub = &lt;li class="dropdown mega-menu-4"&gt; | &lt;/li&gt;
          wrapItemAndSub.insertData = 1
          stdWrap.htmlSpecialChars = 1
          ATagTitle.field = title
          ATagParams = class="dropdown-toggle" data-toggle="dropdown" aria-expanded="true"
      }
  
      ACT = 1
      ACT &lt;.NO
  
      ACTIFSUB = 1
      ACTIFSUB &lt;.IFSUB
  }
  
  2 = TMENU
  2 &lt;.1
  2 {
      expAll = 1
      wrap = &lt;ul class="dropdown-menu"&gt; | &lt;/ul&gt;
      NO {    
          doNotShowLink = 1
          wrapItemAndSub = &lt;li class="one-column"&gt; | &lt;/li&gt;
      }
      IFSUB = 0
      ACTIFSUB = 0
  }
  
  3 = TMENU
  3 &lt;.2
  3 {
      expAll = 1
      wrap = &lt;ul&gt; | &lt;/ul&gt;
      NO {
          doNotShowLink = 0
          wrapItemAndSub = &lt;li class="nav-title"&gt; | &lt;/li&gt; |*| &lt;li&gt; | &lt;/li&gt;
      }
  }
  }
  </code></pre>