Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use Structure to output a select menu

I am working on a responsive site and need to output my Structure powered nav into a select menu for smaller screens. In looking at Structure's documentation this doesn't seem possible natively. Am I missing something?

After some digging it seems like the add-on Structure Entries is the ticket I need with one caveat. SE has quite a bit of overheard (in terms of queries) while using it to spit out custom nav. What's the best approach to minimize the impact performance for complicated menus?

like image 724
Paulo Avatar asked Nov 09 '12 16:11

Paulo


2 Answers

I am doing this currently using Twitter Bootstrap's Button Dropdown javascript plugin. http://twitter.github.com/bootstrap/javascript.html#dropdowns

I also use MX Mobile Device Detect to serve devices the dropdown while the desktop users get the full menu.

I think the Dropdown Button script only allows for a single level list, however since its mobile do you need more than one?

like image 77
Wedodan Avatar answered Sep 19 '22 20:09

Wedodan


I know it's obviously preferable to do it in the template itself, but a JS alternative is TinyNav.js.
It will convert your nav to a select dropdown.

http://tinynav.viljamis.com/

like image 44
Jason Varga Avatar answered Sep 18 '22 20:09

Jason Varga