Module to provide Drupal Etherpad Integration

Events happening in the community are now at Drupal community events on www.drupal.org.
kyle_mathews's picture

I wanted to post something here to get some feedback on the Drupal/Etherpad module I'll be starting on soonish.

My plan at the moment is the create a CCK field which, when added to a content type, will pull in an etherpad into the page via an iframe. When creating the field, you'll be able to choose which of the many free etherpad sites out there you'd like to use or if you have one, your own install of etherpad.

How does that sound? Some people I've talked to about this said they'd prefer the module to just take over the node body. I didn't like that as it doesn't fit my main use cases very well + it'd be fairly easy to do that with a custom CONTENT_TYPE-tpl.php file.

Also, I've never written a CCK field module before so if anyone knows of good documentation on how to do that and could add a link, I'd appreciate the help.

Comments

I like it. I think it sounds

rfay's picture

I like it. I think it sounds great; I haven't researched other possibilities, but this sounds exciting to me.

Media module or an iframe

bonobo's picture

Hello, Kyle,

If you go the iframe route, you could look at the iframe module for some initial ideas: http://drupal.org/project/iframe

Or, have you thought about building it out as an embedded media field-type module?

In any case, this looks sweet. I'd love to see this in action.

My only concern is that with the initial etherpad devs being employed by Google, how is the project being maintained? Have other developers taken over the codebase?

The iframe project does look

kyle_mathews's picture

The iframe project does look like it'll be helpful. Thanks for pointing that out.

I don't think it'd work as an embedded media field-type as those are for embedding existing media where as this module would create a new etherpad automagically each time you create a new node.

As far as is the project being maintained. It seems so. There's 135 issues (http://github.com/ether/pad/issues), 17 people in its IRC channel, 63 people in its Google Group (http://groups.google.com/group/etherpad-dev), and a fairly steady stream of commits (http://github.com/ether/pad/graphs/impact). In any case, it works better than anything else there for my needs and I presume it's not going to get any worse after I install it :)

Kyle Mathews

Cool

bonobo's picture

I'd love to see etherpad take off. It's an awesome app; I just got nervous after it got Goog'ed (Goog. v. to be acquired and swallowed by Google).

some links

marvil07's picture

It seems like there are some more people interested on this at the LA group: Drupal and Etherpad.

In the other hand, maybe you want to take a look at past related proposes:

Interesting

kyle_mathews's picture

Interesting, I hadn't run across that in my exploratory googling. There ideas are pretty much in line with mine. Load a pad on node load in an iframe. Save the Html text back to the node. The only exception is I want to do it as a cck field.

Kyle Mathews

great idea

brendanxc's picture

A good CCK module reference is http://poplarware.com/articles/cck_field_module

How about the following for an implementation?

cck field:
1. database columns:
a. etherpad_id (varchar)
b. etherpad_text (text)
2. field settings:
a. etherpad_url (varchar)
b. desired iframe settings from iframe field module linked above (height, etc.)
3. widget (node edit form):
a. textfield for etherpad_id (+ optional ahah to load the pad or make a new one)
b. iframe loading etherpad_url . '/' . etherpad_id
4. display (node view):
a. etherpad_text

Then add a hook_nodeapi:
On insert/update of types with an etherpad field:
1. drupal_http_request($etherpad_url . '/ep/pad/export/' . $etherpad_id . '/latest?format=html')
2. save into etherpad_text field

nice

kyle_mathews's picture

Nice! That's about what I was thinking except I want the Etherpad iFrame to be displayed on the normal page view as the majority of use cases I can think of, you want everyone to be able to edit the Etherpad where you might not want to allow people to edit the node itself. Plus it's a far quicker process to simple visit a node page and to start editing than to visit the node, click edit, find the etherpad edit field amongst all the other field, and finally start editing. Also, there's still a significant portion of people who don't really get the "click an edit button to change this page" concept.

Perhaps in the future, if people really want to display just the HTML text from an etherpad, we could add a little jquery toggle that when clicked would turn the etherpad display into an iframed version of the etherpad.

Kyle Mathews

should be easier

brendanxc's picture

Ahh, I misunderstood. I agree it would be good on the view page; maybe it would be read-only for users without edit access.

So, when would the etherpad contents be saved to the node body? Etherpad saves revisions all the time, so it would either have to push data to Drupal (plugin?) or the node would need to update on some event (maybe on page load via nodeapi, and on page exit via a javascript callback or a save button?)

saving

kyle_mathews's picture

Since you'd never see the saved etherpad content except for in search results, it's not too critical when Drupal goes out and fetches the HTML. Probably it could pull data on every node save + every 10 page views or something like that so we wouldn't overwhelm the Etherpad server. I also think it'd be good to have the option of turning off the etherpad display and just showing the finished HTML as say that page starting getting a lot of traffic. Etherpad blows up if too many people (>30-60) are connected to the same page at one time.

Kyle Mathews

Working alpha on github

kyle_mathews's picture

You can clone the code from https://github.com/KyleAMathews/drupal-etherpad

There's still lots of missing features but the basics work now -- you can add the field to content types, set your etherpad host, and upon creating a new node, a new etherpad will be created for you as well.

Kyle Mathews

Very glad to find this

tropology's picture

Etherpad is a very convenient tool -- hope to see your module out of alpha soon :)

Awesome

willmoy's picture

This sounds perfect for something we want to do

I wrote a small for etherpad

webflo's picture

I wrote a small for etherpad lite integration. It implements etherpad lite as a field in Drupal 7. http://drupal.org/sandbox/webflo/1255474
The code is a proof of concept and needs some cleanup.

two efforts out there?

kay_v's picture

http://drupal.org/project/etherpad

Sounds like @webflo's sandbox and Kyle's module are two different efforts?

ownsourcing.com - strategy, training, documentation

A third effort:

Drupal in Education

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: