title: Count Childrens in a TYPOSCRIPT menu
body: <p>i am wondering if there is a way in TYPOSCRIPT to count the childrens in a menu.</p>
  
  <p>The output should be something like:</p>
  
  <pre><code>&lt;ul class="ebene1" data-elements="4"&gt;
      &lt;li&gt;&lt;a href="element1"&gt;Element 1&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="element1"&gt;Element 2&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="element1"&gt;Element 2&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="element1"&gt;Element 2&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt; 
  </code></pre>
  
  <p>My Code looks like this:</p>
  
  <pre><code>script.NAV = HMENU
  script.NAV {
      special = directory
      special.value = 6
  
      1 = TMENU
      1 {
          expAll = 1
          noBlur = 1
  
          wrap = &lt;ul class="menu main" id="nav-main"&gt;|&lt;/ul&gt;
  
          NO = 1
          NO.wrapItemAndSub   = &lt;li class="first element1"&gt;|&lt;/li&gt; |*| &lt;li class="element1"&gt;|&lt;/li&gt; |*| &lt;li class="last element1"&gt;|&lt;/li&gt;
  
          CUR = 1
          CUR.wrapItemAndSub  = &lt;li class="first element1 current"&gt;|&lt;/li&gt; |*| &lt;li class="element1 current"&gt;|&lt;/li&gt; |*| &lt;li class="last element1 current"&gt;|&lt;/li&gt;
          ...
  </code></pre>
  
  <p>Thanks, any help is really appreciated.</p>