I would like to extend freelinking so it can play nicely with organic groups. In principle that means:

  • If a freelink is made on a group-owned page, the target will be in that group as well.
  • Allowing group namespaces, so that multiple groups can have [[About The Group]] all point to their own page

I think I see how to add this functionality in, but I'm not sure if this should be part of the module as a whole, or as a .include or maybe a separate version of freelinking. Would love some feedback.

Comments

skor’s picture

+1 for the feature.

Maybe the default sequence could be:

  1. If the node exists within the group link to it
  2. if not, redirect to the creation page

with an option to extend to

  1. If it exists within the group, link to that node
  2. If it exists elsewhere on the site, link there
  3. else redirect to the creation page

Or would that be getting overly complicated? I've just started playing with the freelinking module, so I'm not sure I'm completely understanding it.

Veggieryan’s picture

+1

THIS IS CRUCIAL as wiki's go hand in hand with OG!!!!

I like all the features mentioned.. I imagine some slick ajax that pops up if the node title exists and gives you the option to rename or link to existing..

hooya!

moshe weitzman’s picture

sure, this would be nice. but it is going to be very hard. the core problem (again) is that the filter system knows nothing about the text it is processing. in this case, we need to know which node we are processing in order to know what the destination link should look like.

if we solved that problem, the rest is mostly straightforward. i suggest that freelink_exists be extended so that it properly handles the multiple matches case. if multiple matches are found, send the source node and the potential match nids out in a hook call. og will listen on that hok and reweight the choices to that a within-group link is weighted lowest. then freelink_exists sorts the results and returs the lowest weighted link.

dbassendine’s picture

This is rather more restricted, but just to note you can restrict new wiki posts to a specific group simply by appending the og query to the freelink e.g. from (4.7 version, & bearing in mind the og syntax has changed recently, I think):

$freelink['args'] = 'edit[title]=' . $thetitle

to

$freelink['args'] = 'edit[title]=' . $thetitle . '&edit[og_groups][]=XXX

It might be useful to have a GUI for this, as it enables you to use the groups interface to house your wiki. Links remain sitewide, but all new content lands up in the wiki.

The original request would be ideal, though.

dbassendine’s picture

(that was line 345)

alianov’s picture

Is there a simple way to associate the freelink with its group id?

geek-merlin’s picture

this is important, +1!
subscribing

dr00b’s picture

@tonderai: that's exactly how I'm handling it on my site.

dugh’s picture

subscribe

I added a similar feature request for the wikitools module, since it hijacks freelinking's functionality:
http://drupal.org/node/293240

I posted patched versions of wikitools and freelinking there that work for me. [[Syllabus]] for example will go to the Syllabus page for your group instead of listing all Syllabus pages in all groups.

eafarris’s picture