Linkit module is possibly the most used alternative to Drupal's default link functionality. After using CKEditor Entity Link for a year without issue I decided to switch out the CKEditor Entity Link module for Linkit because I wanted to build a better linking functionality and cut back on the number of linking icons in the CKEditor toolbar. To read more about that you can read a better linking set-up for Drupal.
With that little ramble out of the way let's look at Linkit Module starting with some benefits and then set up and configuration.
The Benefits of Linkit module
- Allows easy search of internal URLs with auto-suggestion functionality. This functionality is also provided by CKEditor Link Module.
- Integrates with the default linking functionality meaning no need to add a new icon to the toolbar. This means one linking solution for both internal and external links.
- It uses system URL paths such as /node/36 and switches them out to use the canonical URL such as /my-cool-article using a filter that works on render. This is nice as you can change URL alias names of linked content and the links still work1. To find out more about setting up pretty URLs be sure to read Drupal SEO must-haves.
Old URLs don't become broken but if you move the site be aware
Even with the above functionality, the node/36 URL is hardcoded into the site so if you are developing on a development server in a directory this will be saved in the database. So I would suggest not entering masses of URLs otherwise you will need to go back in and change the URLs when you go live.
Actively maintained Yes, 110,000+ sites report using it.
Requires No extra requirements
The module's page on Drupal.org is thorough so if you want more details other than those already provided in the benefits section I suggest you check the above link out. Below is a step by step guide to get you set up.
Install Linkit either using the UI or composer. Since there are no extra requirements it can be installed in the normal way. If you are unsure how to install a module please read Installing Drupal Modules where I cover both UI and composer methods.
Once the module is installed you need to enable it on the CKEditor for each text format and editor profile you want to use it. You can do that in the text formats and editors section.
Enable Linkit for the Text Formats that will use it
- Visit Text formats and editors
Manage > Administration > Configuration > Content authoring > Text formats and editors
- Select a text format that has CKEditorImage
- On your chosen text format under the CKEditor plugin settings, there is a Drupal link section where you need to check Linkit to enable it.Image
- Select the Linkit profile. There is only one called default and is perfect for a small site.
- Enable the filter to enable the URL alias instead on the node/# url paths
- Click Save configuration.
Repeat for any other Text formats you what to enable Linkit for.
That's it Linkit is now ready to use for the chosen text format and related CKEditor. If you want to restrict what can be linked to, add a new matcher or create a new profile you can do that on the Linkit profiles pages.
Modify or Create a new Linkit Profile
On install, there is a default profile and it works nicely so there is no need to do anything.
However, if you do want to modify the default Linkit profile or add a new profile you can do that on the Linkit profiles page. This allows you to set up different Linkit profiles that can then be used for different text formats and user roles. This might be useful on a large site and also if you want to integrate a new type of matcher. This topic is an advanced topic and the default profile is sufficient but if you want to check it out it can be found in the Content authoring section.
Manage > Administration > Configuration > Content authoring > Linkit > Linkit Profiles
Things you can change in the default Profile with the content matcher are:
- The meta that is shown in the auto-suggestion window when adding a new link in the content.
- Restrict the content type.
- Group suggestions by bundles (content types)
- Limit search result, this is set to 100 and is fine for most sites.
- Include unpublished nodes. Be careful with this as users would need permissions to visit the links so if they don't have the permissions you get a restricted content message, not a good user experience.
One thing you may want to do is restrict what content types or bundles that can be referenced. For example, your site may have a content type for internal use that can not be viewed by anonymous users and therefore it would be best to remove it from Linkit. Let's take a look at modifying the default Linkit profile.
Modify the Default Profile in Drupal Linkit Module
- Click on Edit Profile
- Click on Manage matchers
- Click on Edit for the Content matcher
- Modify the Setting
- Save Changes
So that's it you now have a new profile to use on the text format and editor page for each text format.
By having this fine controlled functionality built into Linkit and using text formats you can make adding and managing content a nice experience by removing unnecessary clutter in CKEditor. This is one of the reasons why you may want to choose Drupal as your CMS.
Linkit is a simple but powerful module and Linkit would be a recommended addition to all Drupal sites to enhance linking functionality. If you want more details on why I recommend this module over CKEditor Entity Link please check A Better Linking Configuration For Drupal CKEditor to help you decided.
Thanks for reading and I hope you found what you needed. I will write about making Drupal easy and also making beautiful front-ends for your websites whether Drupal or static. If that interests you please sign up for my newsletter.
See you soon.