I've committed (an early beta version of) the S/P Ajax module that attempts to create an API for easily adding Scriptaculous and Prototype JavaScript/AJAX functions to your Drupal themes and/or modules. Other than providing a whole lot of PHP functions, this module doesn't do a whole lot on its own. But it does allow for creating animated message divs - you know, the ones that tell you your node was saved or that your submission has an error. Now you can make them flash a little to wake users up.

The first module based on SPAjax.module is called S/P Magic Menus and it does some sought after things with Drupal's menu blocks. First, it uses the Scriptaculous "blind" effect to toggle the display of submenu items - so, for instance, you don't need to view the node/add page just to get to node/add/story, just click "create content" and out pops the node types without reloading the page. You can also remove the menu blocks from the page flow completely and they become draggable "toolbars" (think PhotoShop's tool pallette). What's particularly cool is that when you drag the menu, its position is sent (via ajax) to the server so it STAYS there as you move from page to page. There is also a setting to choose whether you want the menus positioned absolute (they will scroll with the page) or fixed (they will not scroll with the page).

The concept behind floatable menu blocks is that many designers find it difficult to figure out where to put the "Drupal stuff" after they've designed a site. By rearranging the menu items a little, and maybe adding some conditional (PHP) display in the block configuration, these menus can be be kept from messing with the site design.

Both of these modules open up many possibilities and there is a lot of code to go wrong and/or different/better ways of implementing. So please post comments with suggestions for improvement, areas where you feel things go wrong, etc. I would love some feedback, patches, etc.

Thanks!
-Jeff

--= Jeff Robbins | www.lullabot.com =--

Comments

shane birley’s picture

I just am checking this out and I think it is awesome!

+10dx2 + 5

---
Shane Birley
Vicious Bunny Creative
http://www.vbcreative.com

---
Shane Birley
Left Right Minds
https://www.leftrightminds.com

tema’s picture

Should we get some demo?

jjeff’s picture

I will try to put together a demo of Magic Menus on the Lullabot site in the next few days. I'll also do a demo of this at the DrupalCon AJAX session in Vancouver next week.

--= Jeff Robbins | www.lullabot.com =--

ica’s picture

Great functionality Jeff.. Thank you! -

Just thinking where it can be also useful apart from menu's for users

It would be perfect if its integrated to the Drupal core espacially to admin/menu sorting

imo - currently its a bit problem there, with a long list for admin - menus for public/ registered users confusion...

~ part of the solution would be that is ala spajax -test style- admin menu sorting

and the sorting of blocks replacing the dropdown numbers
just an idea.

jjeff’s picture

Yes, these are good ideas. However I don't think that the sorting functions will ever make it to core (but we can hope). The reason is that the sorting functions do not degrade very well and that tends to be frowned upon in core.

That being said, I could see this being used for an alternate interface to the menu page (maybe a "sort" tab on the admin/menu page) that would allow drag and drop sorting of menus... and while we're in there, how 'bout inline title/description editing? Mmm.... that would be nice!

I'll put some thought into that one. Now who wants to code it?

-Jeff

--= Jeff Robbins | www.lullabot.com =--

bcn’s picture

Thanks so much for this. I just finished making use of your form updater, and then i saw this post... keep up the great work.

jacauc’s picture

Looking forward to see the demo!!

cheers, thanks
jacauc

jjeff’s picture

jacauc’s picture

Been particularly quiet in this area... Is this still being developed.

I love the idea of this module, and would really like to use this once it is committed.

Thanks!
jacauc

rory--’s picture

In IE, the absolute menu doesn't work. Clicking and dragging does nothing, and when using expanded menus, the entire layout gets screwed up.

This is a bit of a problem, because most of my users are stupid IE users. ^_^

ssherriff’s picture

Hi, I was doing a search for prototype/scriptaculous for drupal and found this. I have a site that I am porting to drupal that I used a bunch of scriptaculous stuff. Basically I have a page of songs for an album, and when you click on one of the song names, it opens up so the lyrics can be seen.

I am new to drupal, and so I'm not 100% on how things should be done. I was originally thinking of possibly making a view, but would I be able to use this as an API and make a plugin for this capability? How would I then make a view using that, is it possible? Or is there a better solution?

Stephanie

wickus’s picture

Hi,

this is an awesome module. Great work, but is there any fix for this IE thing? I tested it on IE and there happens nothing beside all the menus are expanded now.

Or is there any idea how to make all the users of my pages Firefox User?

---
Join the virtual march to stop global warming.
http://www.stopglobalwarming.org