I am using Joomla 1.5 and have copied the mod_mainmenu to create a custom menu module. The menu has submenu items (inner UL tags). Here the menu’s HTML:
<ul id="sub-menu">
<li class="parent item10"><a href="link1.php"><span>Arts</span></a>
<ul>
<li class="item29">
<a href="link2.php"><span>Arts Show</span></a></li>
<li class="item29">
<a href="link3.php"><span>Another Arts Show</span></a></li>
</ul>
</li>
<li class="parent item15"><a href="link6.php"><span>News</span></a>
<ul>
<li class="item18">
<a href="link7.php"><span>News Show</span></a></li>
</ul>
</li>
</ul>
I need to take the above HTML and rewrite it to look like this before it reaches the page:
<div id="sub-menu">
<h3 class="parent item10"><a href="link1.php"><span>Arts</span></a></h3>
<div>
<a class="item29" href="link2.php"><span>Arts Show</span></a><br />
<a class="item29" href="link3.php"><span>Another Arts Show</span></a>
</div>
<h3 class="parent item15"><a href="link6.php"><span>News</span></a></h3>
<div>
<a class="item18" href="link7.php"><span>News Show</span></a>
</div>
</div>
How do you do this in PHP? Thanks.
Since jQuery UI Accordion don’t handle nested list, you can use other jquery plugins that does (giyf).
If you want to modify html output from your duplicated mod_mainmenu, then simply locate/modify corresponding code (it should be in a view since joomla use mvc).