How do I use Structure to output a select menu
Asked Answered
S

2

7

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?

Showmanship answered 9/11, 2012 at 16:45 Comment(0)
M
5

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?

Monmouthshire answered 9/11, 2012 at 17:25 Comment(1)
I can split up the nav as needed on the interior pages and am looking at that route. I'll check this option out too. Thanks!Showmanship
H
2

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/

Hobnailed answered 9/11, 2012 at 17:26 Comment(1)
Interesting, I'll check this out. Thanks!Showmanship

© 2022 - 2024 — McMap. All rights reserved.