Rails Semantic Menu Plugin

After Rails Rumble I decided I wanted  to code a plugin to make large menus easier to write. If this interests you, please check Semantic Menu on github.

There is 1 todo left: a default style sheet. That is not something I can do easily, so if you use this project and end up creating CSS for a menu, please share :)

10 comments ↓

#1 Justin Halsall on 10.28.08 at 1:17 pm

Looks good.
1 question though:
why do you attach the menu_level_* class to the ?
You could easely attacht that to the that way you can still target the inner but its a lot less markup.

#2 danielharan on 10.28.08 at 3:20 pm

Thanks Justin. I’m not sure exactly what you’re asking. I thought menu_level_* would make it easier to style - if there’s a better way, let me know and I can change it.

This is exactly the kind of feedback I need :)

#3 Justin Halsall on 10.28.08 at 3:25 pm

hmm, looks like my html was stripped out, here it is again:

Looks good.
1 question though:
why do you attach the menu_level_* class to the “li”
You could easely attacht that to the “ul” that way you can still target the inner “li” but its a lot less markup.

#4 danielharan on 10.28.08 at 8:04 pm

Ah, that makes sense; I’ve pushed the change. Thanks!

#5 Tim on 11.02.08 at 1:08 am

Very cool start… seems it might also be a good idea to allow you to pass :id or :class to both the top of the block to add it on the the primary ul or the added items to the list navigation. This way people can target specific items to have multiple menus and from a design perspective it would allow for doing things like CSS image replace over text links. Thoughts?

#6 danielharan on 11.04.08 at 10:56 am

Tim - please show me what kind of interface / output you want. Link to gist / pastie as my blog install doesn’t play nice with code :)

#7 Tim on 11.04.08 at 4:25 pm

Daniel - this isn’t the greatest of code snippets but it supports the areas of using CSS that I think would be important - such as id declarations and multi-classing. This is very similar to an actual menu I have in production.

http://www.pastie.org/private/z4qjpffpbqf26vbimvnna

#8 danielharan on 11.05.08 at 12:40 pm

Tim - Thanks for the request; I’ve changed the code and README in
http://github.com/danielharan/semantic-menu/commit/bca5c0991db0ee98474308015d97d21f7b055865

#9 Tim on 11.06.08 at 4:28 pm

Very nice Daniel - I like this a lot! Give me some time to really get to use it and I’ll see about making you a default CSS file if you’d like.

#10 danielharan on 11.09.08 at 6:56 pm

Thanks Tim - for those, the best way to reach me is by sending me a pull request on github. A default CSS would be great!

Leave a Comment