title: Magento: How to add active cms-links to the Topmenu?
body: <p>I added this piece of code to the top.phtml. Its a hack from the magento-wiki to get an active Homepage-Link in the Topmenu. It works fine.</p>
  
  <pre><code>&lt;div class="nav-container"&gt;
      &lt;ul id="nav"&gt;
          &lt;!-- HOME BUTTON HACK --&gt;
          &lt;?php $_anyActive = false; foreach ($this-&gt;getStoreCategories() as $_category) { $_anyActive = $_anyActive || $this-&gt;isCategoryActive($_category); } ?&gt;
          &lt;li class="first &lt;?php echo !$_anyActive ? 'active' : '' ?&gt;"&gt;&lt;a href="&lt;?php echo $this-&gt;getUrl('')?&gt;"&gt;&lt;span&gt;&lt;?php echo $this-&gt;__('Home') ?&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
          &lt;!-- HOME BUTTON HACK--&gt;
  </code></pre>
  
  <p>Problems occur when i try to add another link into Topmenu. So i add right behind the Home Button Hack</p>
  
  <pre><code>        &lt;li class="&lt;?php echo !$_anyActive ? 'active' : '' ?&gt;"&gt;&lt;a href="&lt;?php echo $this-&gt;getUrl('references')?&gt;"&gt;&lt;span&gt;&lt;?php echo $this-&gt;__('References') ?&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
  </code></pre>
  
  <p>Problem: Now the the homepage and the cms (reference) link are both simultaneous active or inactive.</p>
  
  <p>How to get this piece of code going?</p>
  
  <p>Greets</p>
  
  <p>ImI</p>