HTML_Menu: trying to create collapsable nested list menu

From: Date: Tue, 11 May 2004 07:54:47 +0000
Subject: HTML_Menu: trying to create collapsable nested list menu
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-29074@lists.php.net to get a copy of this message
Hi, I've got a working menu based on nested lists that can expand/collapse. Like this: <ul id="rootmenu"> <li> <a href="/about/" class="topitem" onclick="return toggle('m_about', this);">About EGEE</a> <ul id="m_about" class="submenu" style="display: none;">
       <li><a href="/about/intro/" id="m_intro">Introduction</a></li>
       <li><a href="/about/partners/" id="m_partners">Partners</a></li>
       <li><a href="/about/activities/" id="m_activities">Activities</a></li>
       <li><a href="/about/contacts/" id="m_contacts">Contacts</a></li>
</ul> </li> .... I'd like HTML_Menu to generate this for me and I think I probably need to write my own renderer for this. But as that is not documented yet, I'm not sure where to start. I need to know if the current node has children so I know whether to include the "onclick" event in that node. I also need to know the CSS ID of the child node. Is there a way to do this? I can do it using the PEAR::Tree package, but that has not got some of the functionality that this package has. Jeroen

« previous php.pear.dev (#29074) next »