In order to better serve users with content that is relevant to their geographic location, the first step will be to add a location field to the group content type 'og'.

Greg can mail group owners to encourage them to fill this in and we can build some onboarding in to remind group organizers to fill it in.

How should be be implemented?
If they aren't location-specific, they can leave it blank, but it might be better for group organizer to explicitly state the group is not geographic, so that the reminder message is only displayed to group owners who haven't filled in the field.

Once this is solved, we need to display this location on the group page (beneath group title?). This field is also browseable from the Group Directory page (requires separate issue).

(Priority set to major for our upcoming sprint)

NOTE: Displaying Group proximity to loged in user will require Bakery work + distance location work and is not part of this issue.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

greggles’s picture

I talked a bit about this with zzolo in Chicago.

He suggested that the cck field in openalyers for d6 - http://drupal.org/project/openlayers - is a decent way to go. But that field is not going to be supported in openlayers for Drupal 7.

D7 has http://drupal.org/project/geofield which does not have an upgrade path but _does_ support data in more or less the same way. So, we should be able to do a manual sql upgrade path if nothing else.

webchick’s picture

Assigned: Unassigned » webchick

I'm going to take a crack at investigating this a bit.

webchick’s picture

FileSize
25.1 KB
468.1 KB
348.31 KB

Ok, spent a few hours playing around with OpenLayers module. It kicks ASS! And in fact, everything you need to do is already helpfully written up over here: http://drupal.org/node/1112308 and http://drupal.org/node/1112320

I wasn't sure if I could just go ahead and start adding modules to the groups scratch site, so for now I did this all on localhost on a clean D6 install. But here's what it looks like:

Group/Event node (can also hide the map entirely, and customize how it looks)

Use either an autocomplete textfield or a map to choose location

Address entry on node form (uses OpenLayers Geocoder to supply text autocomplete field, or you can click the map):

Use either an autocomplete textfield or a map to choose location

Proximity search, table of results (powered by Views):

Proximity search allows you to specify units as well as text locations

Proximity search, map of results (also powered by Views):

Proximity search can show results as points on a map instead

Things this does solution NOT do:

1. Tie location information to users in any way. So people have to type in "NYC" or "Vancouver, BC" or whatever themselves.
2. It doesn't seem to store the auto-complete text anywhere, which means it has to be entered twice (once on the node body, once to get the point on the map). My preference would be to not show the big-ass map on the nodes and instead just show the location they entered in but this isn't really possible atm.

However, I don't think either of those are a reason not to do this, would just be nice feature enhancements in the future.

I'm not quite sure how to get this into a format for easy deployment, and could use some guidance on that. Obviously, I could just grab all the modules and go through the steps manually on prod, but that's probably not the best way. ;) I could do the same on the scratch site so you could play around with it and let me know if it's acceptable. I also took a sanitized DB dump and a copy of the code from prod g.d.o, so I could make these changes locally, then try and make features for the events / groups config on g.d.o. Anyone know how it will deal with the fact that the content types already exist, and are going to have fields added to them?

Anyway, yeah. Let me know what you think! :)

Oh, PS: I didn't incorporate a code review into all of this (I'm woefully under-experienced at Views/CCK-related code to do so), though I did notice that the code isn't notice-free so it spits out errors on a 6.x-dev install. Not sure how much we care about that.

webchick’s picture

FileSize
149.61 KB

Whoops. Guess I forgot to upload that last image.

greggles’s picture

This does look great to me. I'd like to give at least a quick code review before we deploy, but don't let that slow you down.

I am happy to get configuration of these modules in whatever feels like the most appropriate/efficient to you.

lisarex’s picture

Wow, Webchick! Cool!
If possible it would be great to QA on a scratch site, and generally run through the various possibilites.

christefano’s picture

Let me know if and how I can help on scratch. I'd like to test / implement this for the regional groups I help manage. Looks great, thanks webchick!

webchick’s picture

I'm currently blocked on getting this stuff on scratchvm because I forgot my Jenkins password. :\ So I'll need to bug an OSLish person tomorrow about that.

webchick’s picture

Ok, got past that, but now blocked because I don't seem to have access to the update_vendor_branch job. :\

In case someone wants to take care of that part (else I'm also fine trying to track down Narayan), these are the modules that are required:

* http://drupal.org/project/openlayers
* http://drupal.org/project/openlayers_geocoder
* http://drupal.org/project/openlayers_proximity
* http://drupal.org/project/ctools (probably already there)

webchick’s picture

Now I'm blocked on #1141942: Please add user 'webchick' to the 'bzr' group. Getting closer. ;)

greggles’s picture

Component: Group ownership » User interface

Cool!

greggles’s picture

Those have all been merged and deployed to the scratch site!

webchick’s picture

Status: Active » Needs review

Yay!

Ok, I've gone through the steps again on scratch. You can see this in action at:

http://groups.scratch.drupal.org/location_search (just a dumb list)
http://groups.scratch.drupal.org/location_search/map (map search)

We'll likely want more/better Views than this, but this gives an idea of its capabilities.

(Apparently my views-fu is off; I can't figure out how to get them to show up as tabs of each other. I'm going to blame Bluecheese. ;))

You can edit any group or event and add a location to it. I only added a couple of them to start, but I'm about to ping some folks in IRC and hopefully there'll be more soon.

I'm hiding the map from display on the actual nodes because it's big and ugly and I haven't really figured out how to make it not do that. :P Another kind of annoying thing is every time I save the CCK forms I get a WSOD. Not sure if there's anything that correlates in the logs for the past hour or so that might give a clue.

In terms of deployment, I was talking to Ariane about this and she said probably what we should do is deploy Features to the scratch site and try and make a feature for this directly from g.d.o so we pick up custom specifics like field/node types machine names and so on. All the OpenLayers stuff is CTools exportable afaik so hopefully it would make it over, for the most part.

I've added Features 6.x-1.0 to the vendor branch, in case this is desirable.

Also, marking "needs review". Woohoo! :) Thanks, Greg, for all the help!

webchick’s picture

Some obvious feature requests:

1. It would be great if the map search had different coloured dots for local user meetup vs. drupalcamp vs. group. I'm not immediately sure how to do this.

2. It should also probably only show events in the future. This probably means making two separate views for groups vs. events.

3. An update path that attempts to geocode at least the groups, but possibly also the events from today onward. Then we could get an idea of the performance hit.

webchick’s picture

So. Sumitk is AWESOME and overheard my conversation in #drupal-contribute about wanting to create a http://central.wordcamp.org/ clone for Drupal. And so proceded to build out http://46.23.73.24/drupalcamp/ (OMG!!!!)

Only issue is people would have to double-enter events; once on g.d.o, and once on this other site. So what I think we should do is create a feed of events from g.d.o in a view with lat/lon information that could be sucked into a site such as this with Feeds module. (I would love this to end up at events.d.o or something, but that's a separate discussion.)

However, OpenLayers doesn't make that very easy, because the OpenLayers Proximity only exposes a "distance" field, and OpenLayers CCK only exposes the WKT value, which can't be used directly. Shawn DeArmond pointed out that you can configure an OpenLayers CCK field to derive the lat/lon from a couple of text fields instead, but that would require some UI tweaking so they didn't show up on the form. Jerdavis also recommended I look into Geo module, which has a field that stores lat/lon pairs and works with OpenLayers for mapping, so I'm going to maybe play around with that locally, if that sounds ok?

sumitk’s picture

subscribe

webchick’s picture

This link from styol looks helpful for doing different coloured dots: http://www.linnovate.net/blog/drupal-openlayers-display-your-content-map

webchick’s picture

Also, Jerdavis suggested OpenAmplify http://www.openamplify.com/sites/default/files/api_docs/doc_20.html#id25... for auto-geocoding existing nodes, if we want to go with that. http://drupal.org/project/amplify

webchick’s picture

Per discussion in IRC with greggles the other day, the view has now been split into two:

http://groups.scratch.drupal.org/local/groups
http://groups.scratch.drupal.org/local/events

I got some help from malcolm8 and robin.puga today at ariane's hackfest. Now it shows little Druplicon icons, and there are exposed filters on the event view for limiting by a certain date range or event type. There's also an attachment view to show the "textual" representation of the nodes displayed in the view. Yay. :D

greggles’s picture

Getting better all the time!

I tried to associate the denver group with denver. The city name autocomplete worked but I don't see it on http://groups.scratch.drupal.org/local/groups

City name autocomplete doesn't seem to work on http://groups.scratch.drupal.org/local/groups - can that be enabled?

Is http://groups.scratch.drupal.org/local/events showing events in past or future or both? I think we should default to present and future by some amount.

webchick’s picture

Your first and last points in #20 have been taken care of.

The second is an outstanding feature request in the OpenLayers Geocoder module: #937526: Integration with OpenLayers Proximity Filter when Exposed I don't know that I'll be able to code that myself, though. :(

R.J. Steinert’s picture

@webchick Is this the part of the use case I wrote that y'all are trying to get working?

The user enters Waterford, VT in the OpenLayers Geocoder text field and the map zooms to Waterford, VT and the exposed Location filter is filled with the Latitude and Longitude of Waterford, VT.

Is the point selection tool involved? It's hard for me to tell because I don't have access to http://groups.scratch.drupal.org/local/groups :)

webchick’s picture

Oh, I wasn't aware of a use case. Where is that quoted from?

The user/pass is "drupal/drupal". That used to come up on the password prompt. Not sure why it's not anymore.

R.J. Steinert’s picture

@webchick Thanks for the credentials. The use case is the really thick paragraph I wrote in #937526: Integration with OpenLayers Proximity Filter when Exposed.

So y'all just want the "From" field on the filter to offer options in an autocomplete like way using Openlayers Geocoder correct? I can take a crack at that this weekend.

R.J. Steinert’s picture

I posted a very simple patch to utilize openlayers_geocoder's callback in the 'from' form field's #autocomplete_path parameter http://drupal.org/node/1164906#comment-4499232

Note, I get varying results when I set up openlayers_proximity module as an exposed filter (sometimes it works, sometimes the exposed filter's output makes no sense). I haven't had time to debug it but I'm sure it gets into the fact that an OpenLayers view is OL Data Display inside of an OL Preset inside of a Display with OL Map Style.

christefano’s picture

Hmm, I was able to get through the Apache prompt but couldn't log in with my Drupal.org username. It also looks like groups.scratch has been rolled back recently. http://groups.scratch.drupal.org/local/groups and http://groups.scratch.drupal.org/local/events are both returning 404s.

Will it be possible to add more than one location per group? In Los Angeles, for example, we have regular monthly meetups (and a weekly book study group) in 4 different ZIP codes. I don't see any way around this other than asking group organizers to create a separate group for each city / venue in the Los Angeles area.

webchick’s picture

I can't remember anymore since it's been awhile, but I believe it was one location per node.

The way to handle the LA group would be to put "Los Angeles, CA" on the group node, but "123 Star Lane, Hollywood, CA" or "123 Beach St., Santa Monica, CA" whatever on the meetup event nodes.

christefano’s picture

That seems to handle meetup locations, but is there a way to indicate that the group itself has events in multiple locations?

webchick’s picture

Assigned: webchick » Unassigned

I honestly can't remember. And I'm probably going to have to unassign myself from this now because I don't think I could piece what I did back together again. :(

christefano’s picture

Status: Needs review » Needs work

greggles et al., How can we get the work that webchick has done back on groups.scratch so that it can be pieced back together? Assuming it can be redeployed to groups.scratch, what do I need to know in order to log in?

Thanks for everything, webchick!

greggles’s picture

greggles et al., How can we get the work that webchick has done back on groups.scratch so that it can be pieced back together

The modules are all committed, but the configuration is lost (my impression was it would be rebuilt, and I think webchick could have done that if we followed through on launching her features fast enough).

Josh and I ran into some issues in trying to get that version of code live...mea culpa.

webchick’s picture

#3 has links to tutorials that I followed pretty closely to get this done before. It's possible I could find time to do this again, but it will be tricky between now and DrupalCon. Anyone else with OpenLayers experience could likely click together the same thing in a couple of hours.

I probably should've exported it as a feature, but that was problematic because the group/event types already exist on g.d.o. In the future, I'll make sure to post views/CCK exports to the issue though. Mea culpa on that. :(

tom_o_t’s picture

lisarex just made me aware of this thread, I wish I'd known about it sooner! Nice work everyone, I hadn't realized this was even an idea, let alone that it was so far progressed.

I'd like to jump in and help with this, and I'm pretty sure that zzolo would too, although I'm a bit swamped so it will take me some time to get to it. We should be able to put all the configuration into a feature so that it doesn't get lost again. I'm a little concerned about using the ol proximity module with the exposed filter, it doesn't scale very well. But the problems I've had with it are in a different configuration than is described in the comments above.

I've never used groups.scratch, but I'll read around to figure out what the deal is with getting access to that, and reach out if I need help.

I'd love to make the location available in RSS feeds, so that we can then build a central.wordcamp.org clone like webchick alluded to in #15 http://drupal.org/node/1074208#comment-4409574 using the feeds module, which would avoid the need to double-enter everything.

zzolo and I are writing a book on mapping with Drupal for O'Reilly, so were thinking of doing something like this anyway.

tom_o_t’s picture

How do I go about working on this? Will I need an infrastructure account? Is there a repository I can clone? A sanitized database dump? I had a look around but couldn't find any documentation on this process, so apologies if I've missed something.

In the issue queue above webchick mentioned creating a feature for this. Is features being used on GDO? It's my preferred way to configure openlayers, but otherwise I can use ctools exportables.

Should code/configuration go into the groupsdrupalorg module?

greggles’s picture

It's great to hear you can work on this, Tom.

In general it's "just og + views" - no cck involved.

We're not currently leveraging features at all.

If you can create this locally and provide it as a feature that seems great.

If you feel like having a clone of code/db would be helpful I can help get that to you (ping me in irc).

tom_o_t’s picture

Thanks for setting up access for me greggles.

To create the feature I'll need a copy of the code & db so that I can run it locally.

The alternative would be for me to set up the mapping on scratch and just document the steps to do so (enabling modules, adding fields to content types, etc.) The map configurations could be added to the groupsdrupalorg module.

Let me know if you can think of any easier alternative (easy meaning less effort required by one of the GDO admins).

greggles’s picture

The content types and views are now exported as a feature #1265716: Add features module, export all views and content types to features and add them into groupsorg.module.

Getting a copy of code+db is a bit harder, but if you still feel like that's important then we can make it happen.

tom_o_t’s picture

Assigned: Unassigned » tom_o_t

Great, I'll take a look. Just off on vacation for a week so won't make progress any time soon unfortunately.

drumm’s picture

Title: Add a location field to group node » Add a location field to group and event content types

It looks like this issue is discussing both content types, so updating the title to match.

In the last few weeks/months, we have been revamping our staging and development sites. The best way to work on this today is http://drupal.org/node/1018084.

tom_o_t’s picture

Thanks for the link to the new process - I'll take a look and attempt to make a start.

twardnw’s picture

Tom, is there anything you would like my help on? I am currently working on #954708: Redesign groups.drupal.org events view, which is going to tie in to this a little bit.

iStryker’s picture

This isssue is over 1 1/2 years old. I don't get how it is taking so long to get a field added to the group (and the event) content type.

I understand that a view needs to be create to display this, however this issue is just about creating the field. If it is not, change the title.

Are you still working on this @tom_o_t? If not, can someone else take this issue over.

If this work is done, can someone link to the issue, comment and/or patch that does this.

iStryker’s picture

Status: Needs work » Postponed

I talked to twarnw irc. He recalls location data for events being postponed until the D7 upgrade.

I found this comment had good information that can redirect you to other useful information surrounding this issue and events. http://drupal.org/node/954708#comment-6311136

Marking this as postponed

mariomaric’s picture