Hi,
My design team has chosen Codrops Multi-level push menu http://tympanus.net/codrops/2013/08/13/multi-level-push-menu/ so I have to use it.
I've tried the codrops Multi-level menu style http://tympanus.net/Development/ResponsiveMultiLevelMenu/index.html
and Sidr style too http://www.berriart.com/sidr/
but none of them does exactly what I need... Multi-level push menu being a combo of the two.
Looks like I'm gonna have to declare my own style using hook_responsive_menus_style_info()
I hope I'm not getting myself into something too hard. Has anyone ever done that? Any advice or tips to help me on this?
PS : looks like there is a forked version here http://multi-level-push-menu.make.rs/ any advice on which one I should be using? Or which one is easier to integrate into Drupal / this module?
Thanks!
| Comment | File | Size | Author |
|---|---|---|---|
| #29 | multi_level_push_menu-2287635-29.patch | 15.83 KB | geekygnr |
| #24 | multi_level_push_menu-2287635-24.patch | 114.06 KB | geekygnr |
| #22 | multi_level_push_menu-2287635-22.patch | 109.14 KB | geekygnr |
| #13 | multi_level_push_menu-2287635-13.patch | 12.07 KB | geekygnr |
| #9 | multi_level_push_menu-2287635-9.patch | 7.69 KB | geekygnr |
Comments
Comment #1
jwjoshuawalker commentedLove that style. I planned on adding it, but stopped due to lack of time. Nice find on the forked version, many improvements.
Yes, you could write it as your own module and/or straight into RM itself (since the plan is to officially support this one). I would commit a patch adding this style in a heartbeat :)
To add to your module
(These steps would essentially be the same for adding straight into RM, so if you did this we could easily incorporate it into the main module with minimal effort).
This will involve adding 3 functions in the module, and an "integration" javascript file.
The "integration" JS file makes whatever changes should happen to the structure of HTML and/or triggering events, calling functions that the menu library requires (example: The MeanMenu style calling: $(this).meanmenu() after preparations are made, to trigger the library). MeanMenu's integration file here as example:
http://cgit.drupalcode.org/responsive_menus/tree/styles/meanMenu/respons...
Look at the .api.php file in the root of Responsive Menus, or here is a link to the file on Drupal's git server:
http://cgit.drupalcode.org/responsive_menus/tree/responsive_menus.api.ph...
The first 3 functions are what you will need (renamed accordingly), the names for the latter 2 are defined in the first (style_info). The functions are (barring name changes):
hook_responsive_menus_style_info(): Defines the style to RM.example_style_settings(): Drupal FAPI style array for the settings form for this style. The name of this function is defined in hook_responsive_menus_style_info().example_style_js_settings(): Array that is passed to the JS integration file. (See the MeanMenu integration file above to see how the values come through) -- you'll want to iterate oversettings.responsive_menusin the JS, which is dealing with the case of multiple RM instances on 1 page. The name of this function is defined in hook_responsive_menus_style_info().Sweet progress on that forked version, I'd go with that one! http://multi-level-push-menu.make.rs/
Wonderful to see someone pick it up and carry it from there (as is the intention for many of things of this nature posted on codrops -- example to run with).
I know that is a lot of info to absorb. Don't hesitate to ask any questions, I'm very excited at the prospect of this style making it into RM.
Comment #2
nicolas bouteille commentedIn the end the client was happy enough with the Multi-level (non-push) menu style for me not to have to implement the push style... I would still be interested in doing so if I had more time, but I've got another project which I've already delayed because of this one... so not for know :(
Comment #3
brandy.brown commented+1 I would love to see this one in there too!
Comment #4
geekygnr commentedTurns out I need to use this for my companies new web site.
I will try to develop it right in the module and submit a patch.
Comment #5
jwjoshuawalker commentedAnd you shall be a hero among Drupal.
They shall chant your name "geekygnr! geekygnr! geekygnr! "
None shall forget the glory of that day, when geekygnr added Multi-level push menu support.
Comment #6
nicolas bouteille commented:)
Comment #7
geekygnr commentedSo what your saying is no pressure?
Comment #8
jwjoshuawalker commentedNo pressure :)
Comment #9
geekygnr commentedI have been working on this and some credit goes to my co-worker harsimrat who set up the initial static html model for me to work from (I am not that great at frontend dev).
Attached is a patch that has the basics to make it work. The defaults I set on the options are so it will work with the bartik theme. The only part that is broken is I am having some trouble over-riding the css from the bartik theme. The bartik theme main-menu also doesn't include the full menu tree. I tested it by using a fully expanded menu in the main-menu block.
There are a lot more options that need to be added on the form and the Readme needs help but this should be a good starting point from some collaboration and team work. I will likely have more changes in the future as this gets folded into our project.
Comment #10
jwjoshuawalker commented@geekygnr You might be my new favorite person.
I will try to carve out some time this weekend to test this out and see if there are any features I can help out with.
Comment #11
geekygnr commented@drastik, I have already found some problems with my initial patch.
I have made some progress on them. I will try to put up a new patch before I finish work tomorrow.
Comment #12
jwjoshuawalker commented@geekygnr, Any info you can provide on issues you had? I'm about to test this out.
Comment #13
geekygnr commented@drastik
Sorry my post-it reminder failed me Friday and I was out of town all weekend.
Here is a new patch that has some more exciting options.
I think most of the issues I had before was I screwed up some of the desciriptions and what not. It may also need some css help in places.
Comment #14
geekygnr commentedComment #15
geekygnr commentedJust to update,
I have found and fixed a bug that prevented the links from being able to be clicked on.
I am getting some pressure to use the non-forked version so I may end up having to switch to that. Looking at their git hub repos neither seem to have a stellar mainence record. The non forked version has 5 commits but has been updated in the past month. The forked version hasn't been updated in a year but recieved a lot more commits.
I will post a new patch later on when I can get something that has a little more approval in my office.
Comment #16
jbfelix commentedHello
I have tested the patch #13 within a context.
Some options (like collapsed/expanded mode) are not saved when i save the context configuration page.
Result the original menu his hidden but i don't see any link to toggle the mplm menu.
Any help ?
Comment #17
geekygnr commentedHi @jbfelix
At the bottom of the configuration there should be a field set where you can set what the toggle will be.
I am hoping to be able to put out a new patch in the next week or so with a series of bug fixes.
Thanks for your interest in this.
Comment #18
geekygnr commentedOne thing I have discovered is this menu really requires a custom theme to work well. So far whenever I open the menu and it pushes everything right it starts a horizontal scroll bar instead of resizing content area.
Comment #19
jwjoshuawalker commented@geekygnr
Thanks, good to know. A fluid-width (%, not px) design should eliminate this issue right?
Comment #20
geekygnr commented@drastik
I am not sure if that would solve the problem. I am a bit out of my element here but there seems to be something weird with how the javascript pushes the elements. It is adding and removing margins and using the bartik theme on my monitor there should be more then enough white space to fit everything but it doesn't.
Even more interesting is when I set the menu to start open and then collapse the reverse happens and the page gets cut off by a margin.
All of the demos on the website use small content blocks with absolute positions so I am not sure how this menu is supposed to fit with a full sized page.
If anyone has a chance to take a look at this particular problem it would be much appreciated.
Comment #21
geekygnr commentedI found a hack that fixes the weird scroll bar thing. It is not pretty but might give insight to someone smarter than I.
I added the following to the javascript within
$(this).multilevelpushmenu({onExpandMenuEnd: function () { $item = arguments[0]; $item.containersToPush.forEach(function(entry) { entry.css('margin-right', 0); }); }, onCollapseMenuEnd: function () { $item = arguments[0]; $item.containersToPush.forEach(function(entry) { entry.css('margin-right', 0); }); },This at least removes the brokeness and works when the menu is opening left to right. I suspect the left margin will have to be reset for menus opening right to left.
Comment #22
geekygnr commentedOk so I took a look at the multi-level-push-menu javascript and the problem is in there and the best way to fix it is to change the library.
So I have gotten rid of the entry in the libraries hook and had the library live in the module (with the modifications).
I haven't had a chance to test this on a drupal theme so I hope it works as cleanly as it does on my projects custom theme.
I still have more work to do on this for my project so I might put up some new stuff but this is pretty decent as is.
Comment #23
jwjoshuawalker commentedJust leaving a note here:
Noticed font-awesome library being included.
We may want a setting or something in case a user is including it elsewhere (some other method) on their site.
Comment #24
geekygnr commentedI added a setting for the font awesome and the google fonts css that are added in so they can be disabled if needed.
I also added some new options to the form that are centered around the menu's decoration (icons classes etc).
Comment #25
geekygnr commentedHey guys,
Not sure if anyone has been able to take a look at this but the menu as my #24 patch defines has my co-workers happy so I have had to move on to other things.
This menu may have to be an option reserved for those who are interested in using this menu with a custom theme but I still think this would be a solid addition to the module.
I am always keeping an eye on my e-mail notifications from Drupal so if you have questions I am around.
Comment #26
jwjoshuawalker commented@geekygnr
First off, love it. Fantastic work.
I want to get your feedback on some little tweaks that I'm thinking of making after committing your work:
bodyworks well enough for starters I think.body<ul>it finds. I will look into this.Comment #28
geekygnr commented@drastik
If you think the change in defaults make for a better plug and play experience I don't see any reason why not to do it. To be honest it has been so long since I looked at this module outside of our own project with our own theme the defaults probably don't make any sense.
Comment #29
geekygnr commentedI found a bug when deploying. An error shows up when javascript aggregation is enabled on the cache.
It has to do with including //oss.maxcdn.com/libs/modernizr/2.6.2/modernizr.min.js
Here is a patch that adds the file to the repository instead of trying to trick drupal into downloading it.
Comment #30
arlingtonvoicellc commentedIf anyone is in need of implementing this menu on their Drupal 7 site, I wrote a nice tutorial here on how to do it without a module. Example in tutorial
https://www.drupal.org/node/2839395