When writing content - particularly on a large site - it is a laborious task if one should want to link to another internal page using anchor text from within the content being written.

You know how it is: You're writing about a widget, say, and you want to referrence another article on a widget tutorial you wrote 3 mths ago. You're not exactly sure of the URL so you have to go hunting within your own site, copy the URL, return to your draft, then write the link out etc... It breaks your line-of-thought and can add considerably to the time it takes to write an article, particularly where you have several links you want to add.

Something my mind has been drawn towards of late is to have an autocomplete input box within which an author can type in text which they wish to use as an anchor, and have a list of possible matching page titles and URL's returned - Double-clicking the desired matching result pastes a ready-formatted link - together with the queried text-as-anchor-text - into the textbox.

I'd imagine the ajax calls could simply be made to the search function.

Comments on this proposal

Inline API
sun - March 3, 2007 - 16:16

That is exactly what I have elaborated in my (obviously a bit hidden) development enhancement proposal for the Inline module, the so called Inline API. I have plans on working on this topic in the next time. If this DEP is really worth a SOC project, I'd be glad to know.

Daniel F. Kudwien
unleashed mind
======================================================
======================================================

CCK node reference?
papile - March 9, 2007 - 15:45

The CCK node reference box does exactly what you describe minus the creating link in the input box you are working in. It stores the title and link in the node. I think it would be very easy to make it also able to output so you can put it in your text while working on the form. Being that CCK is being put into core, maybe it would be better to see if someone can also add this functionalty using the same code.
======================================================
======================================================

Inline
sun - March 24, 2007 - 20:45

Inline allows you to place an image, link or whatever at a particular, user-defined place in a content. However, Inline is limited to attachments that are provided by upload.module currently. The goal of Inline API is to introduce a new layer between tokens (a user can place into a content) and contents/content-types/objects that can be inlined.

Img_assist module is somewhat similar, but is limited to images uploaded by Image module. It allows a user to select an image that in turn will be displayed somewhere in the content. Img_assist is also integrated with TinyMCE and provides a neat editor button that loads a popup widget to select an image. The goal of Inline API is to provide generic hooks that will allow inlining of any type of content through appropriate widgets. This way, the same widgets can be easily integrated into any rich-text editor (or plain textarea, too).

Dealing with references is slightly different goal. It certainly could be integrated into Inline API later.

Daniel F. Kudwien
unleashed mind
======================================================
======================================================

Good
yngvewb - March 16, 2007 - 06:36

I am looking for something similar. It would be great if it was possible to add a link (i.e. just like you add a link in TinyMCE) where you just could search for the article you want to link to.

I have tried the http://drupal.org/project/freelinking whitch you can tune to make a link to the search page for the word you put in double-square brackets; [[Nick Drake]]. It is nice but not really want I want.
======================================================
======================================================

Scope
praseodym - March 21, 2007 - 09:00

I wonder if the scope of this isn't too small.
======================================================
======================================================

Another vote for this concept
Benjamin Melançon - March 24, 2007 - 09:42

1. Yes, this is needed!
2. The same AJAXy find and add functionality can be used with Agaric's proposed related items.
3. Wandering off a bit from the main focus, letting sites access enough inner workings to index nodes so that they can be referenced with this system would be a great benefit to cross-site community building.

Finally, the page type used to post this "needs work" proposal doesn't show the author, so I'm not sure whom to personally encourage.

~ben

People Who Give a Damn :: http://pwgd.org/ :: Building the infrastructure of a network for everyone
Agaric Design Collective :: http://AgaricDesign.com/ :: Open Source Web Development
======================================================
======================================================

If your using TinyMCE,
onetreehill - May 28, 2008 - 00:53

If your using TinyMCE, here's the solution, the only of its kind:
http://drupal.org/project/linktocontent
======================================================
======================================================
Yes yes yes - want this!!!

This is a feature that is seriously missing. You can not do all the linking you need using taxonomy and CCK fileds. My users need to add links into their comments and nodes to other nodes they have created and have them flow as part of the text... for example (using silly psudo tags)...

"... I have *link to image gallery*uploaded images*/link* from the *link to event*Christmas party*/link* ..."

My users are not tech savvy enough to be able to cope with putting the node path in double square brackets and CCK node reference is too restrictive...

The TinyMCE solution is for D5... anyone know if anyone is planning to do a D6 conversion of that module?

abamarus -
Senior PHP Developer, Halpern Cowan, Camden Town

========================================================
========================================================

psi_rockin -

It would certainly be a great addition, but while autocomplete is a good start I'm not sure that the simple autocomplete provided by CCK would be enough. There's no guarantee that a site won't have two or more pages with the same name or that users will even remember the name. A site map type of view in the link picker would be ideal, perhaps with the option to have lower levels be collapsible/expandable.