Linking Hints

Links help your users find information, but can cause you headaches in the process.

Maintenance Issues

When possible, link to a page by reference rather than by URL. Otherwise, changing the name of the page will break all links to it! In Drupal, this typically means a Node reference field or markup code, and in CoalEngine this means a Page Super-Select.

Another common issue is using path-relative links or including the domain name.

  • http://www.example.com/mypage.html - This link will not work on a development or staging site, and can be very confusing! Also, if you use a secure site (https, for e-commmerce, login forms, etc.) these links will take you back to the non-secure version of the site, and potentially trigger a warning for the visitor.
  • mypage.html - When you don’t include a leading slash, the link target is based on the current page path. When this kind of link is in a menu (or even in the page body), it will occasionally not work depending on where you are in the site tree.
  • /mypage.html - This is normally the best format, since it will work on all versions of your site and regardless of what page you are currently viewing.

SEO Issues

If you are linking externally, you are potentially giving away some of the value of the page. This is important to prevent otherwise useless pages with hundreds of links from gaming the system, but even honest people need to know about it. Any time that you link somewhere off-site or otherwise don’t want search bots to follow, add the rel=”nofollow” attribute to the link. This will often require creating the link tag manually.

A hotly debated issue is whether or not external links should open a new window. There are pros and cons to both the new and same window approaches, and ultimately it comes down to preference. Setting the target=”_blank” attribute will make a link open in a new window.

CoalEngine sites can add external links like these with some special markdown: inside of the [] for the link, use [!< and then >!] to make the link open in a new window and rel nofollow. You will end up with a link like this.