You are here: Home Page > Free Stuff > External Links

External Links

Designating external links, either with a graphic or a different colour, is an important feature of accessible and usable websites. If you or your clients use Textile or a WYSIWYG editor then you may not be able to ensure that an appropriate CSS class is applied to such links. This plugin enables you to do that.

Checked for EE: 1.5.2 + Download: pi.external_links.php (Zipped)

Installation Instructions

  1. Unzip the archive
  1. Copy pi.external_links.php to your /system/plugins/ directory

Usage

Wrap {exp:external_links} around text you wish to process. There are two parameters:

  • class=”the CSS class you wish assigned to external links” (will default to ‘external-link’ if you don’t specify a class)
  • local=”the site domain name”

    So, assuming your domain is ‘myblog.com’ then this:


    {exp:external_links class="external" local="myblog.com"}
    <p><a href="http://www.anotherblog.com">consectetuer</a>, <a href="http://www.myblog.com/gallery/">hendrerit</a></p>
    {/exp:external_links}

    will output this:


    <p><a href="http://www.anotherblog.com" class="external">consectetuer</a>, <a href="http://www.myblog.com/gallery/">hendrerit</a></p>

    It is will take extra attributes like ‘title’ into account and place the class at the end of them.

Free Stuff Categories

Do you like and use any of this stuff?

If so then think about donating something. We can’t promise that we’ll spend it responsibly; Rach will probably want to spend it on toys for Skateboard, Greg will put it towards another Mighty Mouse (’cos his keep breaking).