The link module provides a standard custom content field for links. With this module, links can be easily added to any content types and profiles and include advanced validating and different ways of storing internal or external links and URLs. It also supports additional link text title, site wide tokens for titles and title attributes, target attributes, css class attribution, static repeating values, input conversion, and many more.
Requirements / Dependencies
- Drupal 6: Custom content module (CCK)
- Drupal 7: Fields API is provided already by core [no dependencies].
- Drupal 8: Link module is in core now. No module installation needed. Yay! Don't forget to activate it. It's deactivated by default.
INFO Since some misleading user reports we need to clarify here - Link module is NOT about to add links to any menus or the navigation nor primary/secondary menu. This can be done with default menu module (part of Drupal core). The Link module provides an additional custom field for storing and validating links to be added with any content type, which means another input block additional to your text-body, title, image and any other input you can make on new content creation.
- Drop the entire link module directory into your 'sites/all/modules' folder
- Enable the module from the Administration area modules page (admin/build/modules)
- Create or Edit a content-type and add a new field of type link (admin/content/types in D6, admin/structure/types in D7)
Configuration is only slightly more complicated than a text field. Link text titles for URLs can be made required, set as instead of URL, optional (default), or left out entirely. If no link text title is provided, the trimmed version of the complete URL will be displayed. The target attribute should be set to "_blank", "top", or left out completely (checkboxes provide info). The rel=nofollow attribute prevents the link from being followed by certain search engines. More info at Wikipedia.
If you were to create a field named 'My New Link', the default display of the link would be:
<em><div class="field_my_new_link" target="[target_value]"><a href="[URL]">[Title]</a></div></em> where items between  characters would be customized based on the user input.
The link module supports both, internal and external URLs. URLs are validated on input. Here are some examples of data input and the default view of a link:
http://drupal.org results in
drupal.org results in
<front> will convert into
Anchors and query strings may also be used in any of these cases, including:
Theming and Output
Since link module is mainly a data storage field in a modular framework, the theming and output is up to the site builder and other additional modules. There are many modules in the Drupal repository, which control the output of fields perfectly and can handle rules, user actions, markup dependencies, and can vary the output under many different conditions, with much more efficience and flexibility for different scenarios. Please check out modules like views, display suite, panels, etc for such needs.
Here we link to useful blog posts which point out clever things to do with the Link module, or useful modules to use alongside the Link module.
- Creating an embedded video or audio player for a link field
- Filter allowed protocols module This module allows you to change the default protocols that are set by Drupal to include new protocols like skype. The default protocols, for reference, are 'ftp', 'http', 'https', 'irc', 'mailto', 'news', 'nntp', 'rtsp', 'sftp', 'ssh', 'tel', 'telnet', and 'webcal'.
- Advanced Link module - This adds both a new widget which allows for autocomplete functionality, as well as allowing you to filter the type of links allowed.
- Link Favicon Formatter - This lets you change link's formatting so it displays the favicon of the site the link goes to next to the link.
- ShrinkTheWeb thumbnails allows you to display a thumbnail of the linked page on your page - like how Facebook or Google+ does.
- Link Click Count allows you to keep track of click counts.
Module maintainers and contributors
- diqidoq (Digidog) (since end of summer 2011)
- and sun for porting the link field module to link field module in Drupal 8 core
#D8CX: I pledge that Link will have a full Drupal 8 release on the day that Drupal 8 is released. EDIT: In the moment the status of link module for D8 is, that link module goes in D8 core. Latest development versions of Drupal 8 core already have link module included and if there is no change planned, link module will be part of Drupal 8 core.
Please post to the issue queue to help make the module better. The link module is a must for every custom fields Drupal environment in version 6.x and 7.x and forthcoming 8.x can only grow with your help. Feel free to provide patches and suggestions too.
Link module in Drupal 8 core now! Yay!
The maintainers and contributors for the link module can be proud and happy about informing you that the link module is now part of the Drupal 8 core installation. For Drupal 8 no extra installation of this module is necessary no more.
The stop for Drupal 5 support
Since we have to catch up to get ready for the final Drupal 7 release and have to deal with many feature requests for the Drupal 6 and Drupal 7 version of the link field module, we sadly have to annouce the stop of Drupal 5 support. The files will stay for any individual use or customization, but any support in the issue queue and in the forums has expired from now on.
Development partially sponsored by...
- Maintenance status: Actively maintained
- Development status: Under active development
- Module categories: Content, Content Construction Kit (CCK), Content Display, Fields, Path Management, Site Navigation
- Reported installs: 370,055 sites currently report using this module. View usage statistics.
- Downloads: 2,036,915
- Automated tests: Enabled
- Last modified: November 6, 2015