rah_urltolink

Published under current TXP projects

The plugin is able automatically change text formated URLs into real clickable (X)HTML links. This can be accomplished by simply wrapping the content with a one rah-prefixed Textpattern tag. Generated URLs’ output is customizable by the tag’s attributes.

Download rah_urltolink v0.4.4

Image: rah_urltolink

Image: rah_urltolink

Intro and description

A Textpattern plugin used to automatically change text URLs into real clickable (X)HTML links, aka a elements. The output provided by the plugin can be customized by attributes that allow to set (X)HTML classes, labels, rels and link titles.

For example http://example.com would be converted into <a href="http://example.com">www.example.com</a>.

List of features

Requirements

Installation and usage

The general behavior stands: paste plugin code to the plugin installer textarea and run the automatic setup. Then just activate the plugin and you are ready to use new tags that plugin includes like others.

For usage, basically just put wrap (contain) content in your pages/forms/articles with <txp:rah_urltolink></txp:rah_urltolink>- container tags, and customize output with your desired attributes. All email/www/http/https/ftp/ftps-URLs after with space (space is the fastest and simplest way to validate links and avoid turning links into links again) in the contained content will be turned into links.

Attributes

The tag is <txp:rah_urltolink> and attributes for it follow.

language
XHTML link’s, a, language attribute/value fi, en, de, se.
Example: language="en" Default: ""

class
XHTML class assigned to links.
Example: class="link" Default: ""

label
Link’s anchor element: label. If unset (empty), link with out leading http will be used as an anchor.
Example: label="[link]" Default: ""

rel
Link’s rel attribute.
Example: rel="nofollow" Default: ""

title
Link’s title attribute.
Example: title="Click link" Default: ""

protocols
Select appending protocols that are included in URL-to-Link conversion. Valid values: http, https, ftp, ftps, www, and mail. Comma seperated if multiple.
Default: protocols="http,https,ftp,ftps,www,mail" Example: "www,http"

Example

<txp:rah_urltolink>
	We have some content here.
	<txp:article />
</txp:rah_urltolink>

Changelog

Version 0.4.4

Version 0.4.3

Version 0.4.2

Version 0.4.1

Version 0.4

Version 0.3

Version 0.2

Version 0.1