Drupal 8 Module of the Week: Linkit

Each day, more Drupal 7 modules are being migrated to Drupal 8 and new ones are being created for the Drupal community’s latest major release. In this series, the Acquia Developer Center is profiling some of the most prominent, useful modules, projects, and tools available for Drupal 8. This week, a handy-dandy usability module called Linkit.

Amusingly (or confusingly!) known as anon on Drupal.org, the module’s maintainer, Emil Stjerneman, has been a Drupal consultant and developer in Sweden since 2009. He helped me understand more about Linkit.

What does the Linkit Module do?

Since late 2009, the Linkit Module has improved usability in WYSIWYG editors for content authors in Drupal. Emil tells us the problem, "Without Linkit installed, the most common way to insert a link in the WYSIWYG editor is to open the default WYSIWYG link plugin and populate the URL text field by either copy/paste or typing the URL directly into it. The risk inherent in this method is the chance of pasting or typing a broken or incorrect link into the field."

Linkit adds a link plugin to CKEditor, Drupal 8's core WYSIWYG editor. The Linkit link plugin gives content authors an autocomplete field--a dynamic search field--that lets them search for link targets and gives them link suggestions based on their input. Suggestions include the URL and title of the target(s) and Linkit can be configured to show other information as needed. This gives authors and editors confidence that they are including a properly formed link and linking to the correct target.

Linkit includes basic support for including all entity types and it is configurable beyond its autocomplete display options. Other options include search scope (internal/external) and different Linkit settings for different text formats.

Linkit autocomplete search in action

Why is this important?

Including broken or incorrect links in your site content can have a negative impact on your visitors' experience, reduce your SEO ranking, or hurt conversion rates. Depending on the scale and purpose of your website, this can potentially cost you real money from loss of sales, loss of ranking and therefore advertising revenues, and more. Linkit is an effective way to help your content teams avoid errors like this.

When was Linkit created?

"Linkit was created 2009 when I saw that some of my customers had problems linking to internal content. On the one hand, they would often know the title of the article they wanted to link to, but not its URL. And on the other, some of them were less tech-savvy and telling them, 'Just insert the URL into the link plugin text field,' was neither very helpful nor very user-friendly. I thought that giving them an autocomplete field to search for the content instead would be helpful. This method has turned out to be very effective and I am pleased that about 60,000 websites report improving authoring usability using Linkit! I'm glad my module the makes the work days of so many content authors a little bit easier."

Has Drupal 8 changed this module?

Some of the functionally that was in the 7.x version is now in the Drupal 8 core. For example, Linkit 7.x needed to have field integration to be able to use Linkit with Text and Link field types. Drupal 8 core includes entity references, which provide very similar functionality. So I could take those differences into account in my code and outsource all that to core.

I stared to develop the 8.x version of Linkit in October 2015, with the goal of releasing a stable version November 19th, 2015 ... As these things usually end up going, I actually got the first stable 8.x version out the door January 10, 2016 :-) One of the challenges of building the new version turned out to be the fact that there weren't so many modules out there to take solution-inspiration from. I also had to get used to the lay of the land in a new and very different Drupal core. I still had a great time. I really enjoyed porting the module and the process helped me learn a lot about the new concepts we've implemented in Drupal 8.

Learn more

Read Emil's post, All About Linkit for Drupal 8 on his website, www.stjerneman.com.