Looking for an updated version of this tutorial? Check out “Create Internal Links using the Linkit module in Drupal“.
What is the best way to link from one piece of content to another on the same site? You could hard cade URLs in the body of the text or you could use the Linkit module. The Linkit module gives you a pop window with an easy interface which allows you to search for content using an autocomplete field, then simply insert a link into a text area.
Linkit requires some type of WYSIWYG editor; it works with Wysiwyg (TinyMCE or CKEditor) or the specific CKEditor module. In this article I have installed the CKEditor using the Wysiwyg module.
Installation
Go to the Linkit project and download the modules into sites/all/modules
. Linkit requires the Ctools module, make sure you have that already installed. Go ahead and install Linkit.
Configure Linkit
Linkit’s configuration options are managed as “Linkit Profiles”. This is very powerful because it allows site builders to build different profiles based on a user’s role. For example, suppose you have two roles, one called “publisher” and another called “editor”. Users with the “publisher” role can only link to other nodes, where as users with the “editor” role can link to everything (nodes, files, etc). All you have to do is go to admin/config/content/linkit
and create the custom profiles. Linkit creates a default profile when you install the module. We’ll use this profile throughout out this article.
Next, go to the Wysiwyg profiles and enable the “Linkit” button.
Use Linkit
Now that everything is configured you should see the Linkit button on the Wysiwyg editor.
Simply click on the button, then search for content using the “Search content” field.
If you insert a link without selecting any text, the link will be used for the text which doesn’t look that nice.
To avoid this just select a bit of text before clicking on the Linkit button, then the selected text will be used for the link.
Finally, because Linkit module stores configuration as profiles, you can export profiles into features.
Another little helper to add to my arsenal. Thanks for preparing all these articles and videos.
Hi Ivan,
Linkit does just what I want, but there is one problem. Cannot find the solution in your video or the detailed tutorial.
Your tutorial shows Linkit as displaying on the results drop down, in addition to the Title the words “by Admin” and the date. This does not show when I install it (Drupal 7). Many of my nodes have the same titles (e.g. in Articles, “Book Reviews”) as they are created from articles in a bi-monthly magazine, but I want to distinguish one Book Review from Another.
Can you tell me how to achieve the same display as in your tutorial? Have tried setting the content type to display author and creation date but this does not help.
Would value your help.
Brian
I have never seen that problem. Which Linkit version are you using?
Hi, I’m the maintainer for Linkit module and I’m very glad that you like my module and made this tutorial, I really appreciate it.
Brian: What you are asking for is the “Result description”.
That can be configured in the linkit profile under the search plugins.
Thanks for the comment.