0

I have been pondering on how to modify the default output of Nice Menus' list elements and make each <li> group a list of nodes by taxonomy term. This is the default output of a sub-menu:

<ul>
  <li>Test 1</li>
  <li>Test 2</li>
  <li>Parent
    <ul>
      <li>Sub 1</li>
      <li>Sub 2</li>
      <li>Sub 3</li>
      <li>Sub 4</li>
      <li>Sub 5</li>
      <li>Sub 6</li>
    </ul>
  </li>
  <li>Test 3</li>
</ul>

My goal is to group sub-children based on a taxonomy term such as:

<ul>
  <li>Test 1</li>
  <li>Test 2</li>
  <li>Parent
    <ul>
      <li>
        <h3>Term 1</h3>
        <a href="#">Sub 1</a>
        <a href="#">Sub 2</a>
        <a href="#">Sub 3</a>
      </li>
      <li>
        <h3>Term 2</h3>
        <a href="#">Sub 4</a>
        <a href="#">Sub 5</a>
        <a href="#">Sub 6</a>
      </li>
    </ul>
  </li>
  <li>Test 3</li>
</ul>

How can I customize this on template.php?

ralphcarlo
  • 209
  • 6
  • 22

1 Answers1

0

there's some nice hook code in here which allow you to alter menu links and menu tree

please_reboot
  • 143
  • 10