I've been tossing around the idea of adding a new feature to D6 Nice Menus that will let folks who know nothing about CSS just select a different style for their menus through the admin UI. My main target and first thought was so that we could have a selection of styles that matches the different core browsers. Basically just so instead of the current default grey box look, a user could pick something that blended in with their selected core theme. Then we can also add in some other generic nice looking styles. This is targetted to people who know nothing about CSS and/or don't want to futz around nor need a custom, exact match for their sites.

The idea I am thinking of would just add a styles dir to the Nice Menu module that would have nice_menus_xxxx.css files that override the nice_menus_default.css. We'll also toss in an images dir for helper images. Then in the admin UI for NM there would be a list with mini screenshots of each style and the user would just select the one they want to use as the default with a radio button.

I'm thinking I'd also move the "type in the path to your custom override" box to that screen as well so it would all be together. I feel like setting the NM default style is more of a NM admin thing than a Global theme thing but I'm open to discussion on the best place for this.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

add1sun’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev

Will go into the new version in HEAD.

add1sun’s picture

Status: Active » Needs work
FileSize
1001 bytes
4.06 KB

OK, here is a *very* rough first pass. It isn't pretty and needs quite a bit of work but I was playing around with it and figured I should get a patch up so I don't lose it. It is using a new directory (called styles) which I can't add to a patch so I am uploading the patch for nice_menus.module and then a tarball of the new dir with a sample css file in it. Again, the CSS in the styles dir is fugly and not complete, but more a proof of concept for picking a style.

This also moves the path for custom CSS to the settings page instead of the theme config, where no one can ever find it.

sstedman’s picture

Good work. Looking forward to this development. I think this is a pretty important piece for the usability / aesthetics of drupal. It would also be cool to add different styles of menus, such as superfish, suckerfish, menu fade ins.

Also, a good usability piece - maybe a color picker for the menus like what is used for the Garland theme. Set the hover color background and foreground, active color background and foreground, top level tab hover & active background and foreground color, border colors, etc. Perhaps these colors could be applicable to .pngs for gradient and translucent effects?

Just thinking out loud. I think dropdowns should be in the core or at least in the Acquia release. I am considering applying for the Google Summer of Code 2009. Maybe I will propose some of these enhancements in tandem to your work?

add1sun’s picture

Note that NM actually uses Superfish now and you can configure various things about it. Re: the color picker, that would indeed be very f-ing cool. I don't know that I have time to get that fancy right now but definitely a feature I would add.

With regards to the current patch, I am also thinking that it would be nice to have NM provide some basic styles to choose from, as well as automatically looking in the theme to see if there is an overriding NM style sheet. Won't have time to code on this more for a little while yet, but I'd like to get a rudimentary system in place in the next few weeks so I can start rolling alphas of version 2.

sstedman’s picture

Hey, I am going to submit this as my project for the Google Summer of Code. I also think it would be quite cool to add the color picker to menus. I can also work on some prepackaged styles. I only have a couple more days to submit my idea, so I am going to draft it up and send it in. Obviously, it would be helpful if you could assist with occasional questions on the module. Let me know your thoughts on this. Thanks

add1sun’s picture

@sstedman, sorry for the delay in responding. Yes, I would definitely assist with this and could be a mentor on the project, if you get accepted. Let me know the status of things. :-)

BTMash’s picture

Status: Needs work » Active

Hi,

I'm not sure if this one is being worked on by anyone at the moment but since I haven't seen anything on it, I am beginning work on it, hit a stumbling block, and already have a question...
I am attempting to make it so that each menu block could have a different style associated with it (eg. different colors) and placing the configuration for it in the block config page but the first stumbling block I have is while this can effectively work with custom css styles, loading a particular (from a premade list) stylesheet would also alter the way the second menu block would look as well (so nice menu 1 would have the same style as nice menu 2 based off the preselected stylesheets). Any suggestions on how that could potentially be tackled?

I'll post up a patch version of what I have up an running soon (may essentially end up as an equivalent to what add1sun has made so far).

BTMash’s picture

Status: Active » Needs review
FileSize
5.08 KB
2.92 KB

Ok, I **think** I have applied the patch against the correct version from the cvs repository. I borrowed a chunk from what the fivestar module does for all the fivestar widgets to get this functionality up and running (though we could use drupal_system_listing if we want the style to be more strict). So what are the changes:
1) Styles directory will consist of subdirectories (default being one of them)
2) Style configuration has been moved to the blocks page with the settings for the other aspects of the nice menu block.
3) nice_menus gets a listing of the various styles (through a hook invocation so other modules can provide their own set of styles) which can be selected from (its a radio list)
4) You can override the selected listing with a custom style file field (if the css file does not exist, it will revert to the selected listing)
5) The file is added in theme_nice_menus because I also add a class to the menu on what type of style it is getting. This would allow for overriding styles (so they would have ul.nice-menu.<my-selected-style-name-from-directory-or-custom-file> and place their necessary rules).

I am simply using the same files that add1sun provided as a proof of concept (I am not a designer by any means) but if what is there at the moment works well, then hopefully some nice styles can come with it :)

Adding

add1sun’s picture

Status: Needs review » Postponed

Postponing this to D7 since we need to get a stable 2.x out for upgrading and I don't have time to work on tis in 6 anymore.

Scott J’s picture

I am just setting up a Drupal7 site, and noticed that Superfish module does something similar, so perhaps there are code ideas to be had there? See also #776480: Additonal styles

xiukun.zhou’s picture

Issue summary: View changes
Status: Postponed » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.