PDA

View Full Version : Is there a quick way to do drop down links?


alexgeek
01-20-2008, 10:06 PM
A quick way to do the fly out boxes like the quick links one?
I need this for a mod that members can save their favourite links.
Tah :)

cheesegrits
01-22-2008, 12:08 AM
Just look at the default navbar template and see how it's done. Basically two parts - the link in the "nav buttons bar" section which calls the vbmenu_register javascript, something like

<if condition="$show['my_link_mod']">
<td id="my_link_mod" class="vbmenu_control"><a href="$show[nojs_link]#my_link_mod">$vbphrase[my_links]</a> <script type="text/javascript"> vbmenu_register("my_link_mod"); </script></td>
</if>


then the 'div' with the actual menu items (as a table) in it in the "NAVBAR POPUP MENUS" section:

<if condition="$show['my_link_mod']">
<!-- user cp tools menu -->
<div class="vbmenu_popup" id="my_link_mod_menu" style="display:none">
<table cellpadding="4" cellspacing="1" border="0">
<tr><td class="thead">$vbphrase[my_links]</td></tr>
$my_links
</table>
</div>
<!-- / my link mod -->
</if>

Obviously you'd have to generate the actual table content ($my_links) on the fly in your mod. Each link would be of the form:

<tr><td class="vbmenu_option"><a href="link_url">link text</a></td></tr>


-- hugh

alexgeek
01-23-2008, 05:32 PM
Brilliant, thanks~!