Enable the filter(s) for an input type and run filters in appropriate order.

The Internal Links module, Intlinks, is a simple set (currently two) of input filters which modify the output of internal, root-relative links in any text input format for which they are enabled. The title filter allows you to have the node titles of linked content automatically inserted into the link as the HTML "title" attribute, with "node/123" -type href paths converted to URL aliases, too. It is especially useful for streamlining the editorial workflow and improving SEO. You can also use the "Hide bad" filter to "unlink" unpublished content so visitors don’t encounter "page not found" errors.

Introduction

Maintainer and Author: Lowell Montgomery.
This module was written as a part of my internship as a Drupal developer with Cocomore. Thanks are due to Cocomore’s senior developers, especially Markus Kalkbrenner and Christian Spitzlay (both formerly of Cocomore), who provided invaluable guidance and support to help ensure my first module worked as conceived.

The Internal Links Title filter inserts HTML title attributes into links to other nodes on a site (if no title attribute already exists) using the linked node’s title as the HTML title attribute’s value. It also replaces href values which are in the “normal Drupal path” form (e.g. <a href="/node/123">) with a URL alias, if one exists. It leaves any other attributes alone. It is especially useful for sites which have a lot of related content which can more easily be cross-linked, with less effort on the part of editorial staff and improved SEO. And if “normal Drupal paths” are used, it will also maintain any links if the URL aliases are modified, for example, to improve SEO, to make an update, or to correct a typo.

The Internal Links “hide bad” filter could probably be better named. Its main purpose is to remove internal links to nodes which aren’t (yet or any longer) published or don’t exist, to avoid users seeing “page not found” errors when following links on your site. It checks URL aliases and/or normal Drupal paths to see if the node exists and checks whether the node is published, if so. If it finds no node under the linked URL, it also checks the “menu_router” table for non-node paths which could also be linked (e.g. a path to a Views page). It only removes internal, root-relative links which are not found as nodes and/or are unpublished and allows all other paths found in the menu_router table without testing particular paths for validity if not actually to a node. If a link is removed, the anchored text is left in place, only the <a></a> tagset (and any attributes within) are removed. The filter, by design, attempts to err on the side of leaving links alone, since otherwise its effect could be problematic. We suggest turning it on only if you know you have links to unpublished content, especially content you’ll be making public over time, or if there are many old links (to unpublished content) which you don’t have time to more permanently remove. This filter is a bit more experimental and we appreciate reports of any issues you find using it.

Content should consist of reasonably well-structured HTML with double-quotes around HREF values, and with all internal links “root-relative”, i.e. starting with a slash, (‘/’), followed by the normal Drupal path (best) or path alias. I could have used regular expressions which would allow just about any HTML a browser will render, but that adds to processing and we should all be using nicely written HTML, right? ;-) Normal output from the common WYSIWYG text editors (CKEditor, TinyMCE, etc) should work fine.

Installing

See Drupal's handy instructions on how to install or update Drupal modules.
Please see this blog post for full, illustrated directions.

Uninstalling

This first release of the Internal Links module does not write anything to the database, so there is no need to run update.php after installing/uninstalling the module. If removed, all traces of the module are gone after any cached content is cleared.

Frequently Asked Questions (FAQ)

There are no frequently asked questions at this time. Feel free to change that if you have any questions. ;-)

Known Issues

The module was written without a lot of flexibility. More features and/or options may be added in future.

  • The filters require extra database queries, so use them on cached content. A busy site (or a shared server) will likely see delays if the output of these filters is not cached, especially if there are many internal hyperlinks on a typical page.
  • The Hide bad filter is really designed to unlink unpublished nodes. It does not check that other possible internal links are valid, but attempts to leave them, as-is.
  • The Title filter currently only gets the titles of nodes, not special Drupal paths, such as Views pages, taxonomy paths, etc. Improving this is a goal.
  • This module was written for a monolingual site before there was much support for multilingual sites in Drupal 7. Improving support for multilingual sites is also a goal and is taking place in the 7.x-2.x branch. Currently this work only supports content translation, but we would also like to add support for field translation, including the Title module.
  • At this time, there is no reason for monolingual sites to use the 7.x-2.x branch and we will attempt to add all improvements which are not multilingual-support-related to both branches.

More Information

To issue any bug reports, feature or support requests, see the Internal Links module’s issue queue.

How Can You Contribute?

Sponsors

Project Information

Downloads