The Word Link module is a great time saving tool because it allows you to store repetitive words and links in Drupal. For example, if you write a lot of articles about Drupal and want the word Drupal to appear as a link in your content, then use Word Link.
Of course, you could manually convert a word into a link, but by using Word Link all you have to do is define the word once and the module does the rest.
In this tutorial, I’ll show you how to define words as well as how to import and export them.
Simply download Word Link and enable the “Word Link” and “Word Link exchange” module.
If you use Drush, run the following command:
$ drush dl word_link
How to Define Words
The first obvious thing we need to do is add in some words.
1. Go to Configuration -> “Word Link” (admin/config/content/word-link) and click on “Add new word”.
2. Add in a few words like Views, Drush and Drupal. Also, add a URL to each word.
When you define a word the only fields that are required are the “Word/Phrase” and “URL”. You can also configure if the word is case sensitive and define a URL title. You can control which page the word is converted on by adding page URLs to the “Show links on specific pages” text area field.
Configure Word Link
Now that we have created a few words, we need to configure Word Link and choose which fields should be processed. If the module finds a defined word, it’ll appear as a link.
1. Go to Configuration -> “Word Link” (admin/config/content/word-link) and click on the Configuration tab in the top right corner.
2. Click on the Articles field-set and select Body from the multiple drop-down list, and click on Save.
All the other configuration options are pretty much self-explanatory. However, one option I want to draw your attention to is the “Convert limit” configuration.
This option allows you to define how many instances of a particular word will appear as a link. So if it’s set to
0 then all words will be links. But if it’s set to
1 only the first instance of a word will be converted.
Go ahead and create a test piece of content to make sure the words are processing correctly. If everything has been setup properly, you should see a bunch of links within the content area of the page.
Import and Export Words
Word Link ships with a sub-module called “Word Link exchange” and its sole purpose is to offer import/export functionality. Words can be imported via a CSV file or you can import directly from any taxonomy vocabulary.
The import page can be accessed by going to Configuration -> “Word Link”, once there click on Import.
If you want to import taxonomy terms, then simply select the vocabulary from the “Import from taxonomy” field-set and click on Import.
Another option, if you want to import words using a CSV file then add the file to the “CSV file” field and click on Import.
Below is how the CSV file should be formatted:
Views;1;http://drupal.org/project/views;Views;word-link;0;"" Drush;1;http://drupal.org/project/drush;Drush title;word-link;0;""
Exporting words out of Word Link is very easy. Just click on the Export tab and choose how you want the CSV exported and then click on Export.
If you have any questions, please leave a comment.