Recently, I received the following request from a client:

“Can the internal links options not (sic) include a way [for] a web page maker … [to] browse to the file on our local site, rather than having to copy and paste the URL — With Dreamweaver, we can browse to the pages we want to link internally, without having to browse to each page, and copy and paste the link each time. Is there a similar functionality you could install for us?”

I had wanted to provide a similar functionality in the past using Drupal, but never really had much reason to look for a solution. After discussing it internally, a member of our team mentioned a module that I hadn’t come across before: linkit. linkit was designed as a module-based solution that does exactly what the client asked for. It allows one to search nodes in the content editing context via an elegant interface: The module is a WYSIWYG-based plugin compatible with both tinyMCE and CKEditor. It is almost a complete replacement for either libraries’ link button:

linkit target module

 

The reason that it is almost a replacement is that it does not include the option to set a target attribute within the generated link.

The developers of the link had good reason to exclude this feature, in wanting to respect the XHTML specifications for the <a> tag that does not support the target attribute. In practice, however, this has never quite been a respected change in the docType specifications even while content creators have continued to demand this option.

The site that is being developed with this module is using an Omega sub-theme, which is written in HTML5 which does in fact restore support to the target attribute. A bit of search on the issue queue will lead one to this post in which the whole case for target is brought up and shot down. The user (granite230) has provided a great function that one can add to a custom module to achieve the desired options.

I thought I would save people who are not comfortable with module building the headache and released the module linkit target. A simple cut and paste of the the function into the a contrib module.

I hope this makes life easier for you.