My site will list lots of community organisations (using the contacts module). I want users to be able to create an event and include a freelink to the organisation that is coordinating the event. Freelink can do this. My problem is that users will sometimes mis-type the name of the organisation. I don't want freelink to assume that the user wants a new node - I want it to ask.
So, it would be fantastic if there could be a configuration setting with three options as follows...
What to do when node title does not exist
1. Always create a new node
2. Warn the user that does not exist and it will be created
3. Create an error and tell the user that does not exist. S/he should check the spelling
Freelink looks like a very valuable module. Thanks for all your work on it.
Warm regards,
Chris
Comments
Comment #1
eafarris commentedWhile I like this idea, it's not possible to implement in freelinking.module without changing it significantly.
The way freelinking.module makes links currently is to scan through the text, looking for link-ish things, and marking them up with a link to freelinking/(whatever). It does not attempt to link to node/(whatever), because, to do that, it would have to scour the database looking for a title, and do that for every freelink it finds in the node body. A very expensive operation, particularly at content-creation time.
Instead, the node lookup is done 'on click,' when a user clicks a link that goes to freelinking/(whatever). At THAT time the db is searched for a suitable target, then is redirected to the appropriate actual page. This moves the expensive operation back to where it would be least noticable -- during surfing.
So, there is currently no way to know at content-creation time whether a link points to an existing target or not.
I'm serious when I say that I like the idea. I can definitely see the benefits, but I'm afraid we'd sacrifice too much to implement it at present. That said, if the code's not too much, perhaps it can be implemented via a "Resolve Freelinks during content creation" checkbox in settings, and then just taking separate paths down the code. I have a lot of more pressing things in my Next Action lists right now, but it's worth a look at least. Anyone want to cook up a patch?
Comment #2
rajaiskandarshah commentedhi,
first of all i am not a php programmer, but i do understand a little bit of sql statements.
i modified part of the freelinking.module to the following:
so that if the title can't be found, it will produce a search result page. useful for people who do not have access as a content writer.
a sample page: http://norazilaco.biz/?q=node/6708
how do i add this to the list of options in home >> administer >> settings >> freelinking configuration ?
thanks
Comment #3
eafarris commentedI committed this feature, with options, to DRUPAL-4-6. Thanks, barc and rajaiskandarshah! Still to do for HEAD.
Comment #4
eafarris commentedNow in HEAD as well.
Comment #5
(not verified) commented