Closed (won't fix)
Project:
Wikitools
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
9 Aug 2008 at 16:37 UTC
Updated:
11 Feb 2011 at 05:16 UTC
Jump to comment: Most recent file
Comments
Comment #1
dugh commentedI have this working by adding the group ids to the query string of the freelinking url (freelinking/Pagename?gids[]=424), but it's not really done in a manner that will work for everyone.
I attached my copies of the modified freelinking & wikitools modules.
It has these limitations:
I am using the latest 5.x version of the organic groups module. I have my wiki content type set as being able to be posted to groups. This forces people to choose a group when submitting a wiki page (unless you are admin).
I am using freelinking and wikitools, with 'hijack freelinking' checked.
I am not using wikiword links (don't like them).
I unchecked 'Unique Titles' in wikitools preferences, to allow pages of the same title to be submitted (would need to be fixed properly eventually).
My code also only supports one group per wiki page. If you check off a wiki page as being in multiple groups, only the first group will show up. This is an og module limitation, but could be overcome.
I am using global_redirect module too and of course pathauto. I have a pathauto node path for wiki pages like this: [type-name]/[ogname-raw]/[title-raw].
Here is the code:
In freelinking.module around 278 I changed the $replacement line to this:
Make a similar change a little lower if you want wikiwords to work as well with groups.
This is not really necessary since wikitools overrides this, but I also add this around line 368 near the end of function _freelinking_make_link before the call to _freelinking_store:
Changes to wikitools.module:
Change the wikitools_create_url function (around line 589) to this:
The other fix (around line 432 in wikitools.module inside wikitools_handle_request function:
So now if you have a link like [[PageName]] and multiple groups have wiki pages with that name, it will go to the correct one in the current group, or if no page of that name exists in the group, it will make it so that when you create the page, the current group will be pre-selected.
One other issue with the code - if you have a link to a page that doesn't exist in current group but does in another, the link will go the other group's page. If you don't want that to happen, uncheck 'Automatic Redirect' in the wikitools preferences. Actually if you uncheck that, it will list the pages from other groups, but still display the link to add a new page with that name in your own group.
Comment #2
jpmckinney commentedOld issue. OG integration should probably go in its own module.