Content last modified Tuesday 24 August 2021
hop to #bottom
Categories:
Author:
Current version:
0.5
About It:
Get it:
Rate it:
  • Helpful?
  • 3 Yes
  • 0 No
Flag it:

If you'd like to provide updated information and do not have access to directly edit, please contact the site admin; thanks!

adi_link

Summary

adi_link will output links from various sources, with custom attributes.

Once installed and activated, you’ll get a new tag: <txp:adi_link/>.

See the help supplied with the plugin, or have a look online.

I’ve bundled up a few ideas into one plugin. To summarise, adi_link provides functionality to:

  • take a URL via an attribute (e.g. http://www.example.com/) and output the link with text “www.example.com”
  • take a URL stored elsewhere (e.g. in a custom field)
  • render link as an “external” link (with specific class & rel)
  • take a URL from the TXP database using a supplied TXP link ID
  • parse & enhance links in an article (like jra_ext_link)
  • render HTML id, HTML rel & CSS class (which can be supplied as tag attributes)
  • render titles & link text (which can be supplied as tag attributes)
  • render section/category links
  • insert page anchor into a link
  • insert GET vars into a link

Usage

adi_link can be used as follows:

  • as a single tag: <txp:adi_link/>
  • as a container tag: <txp:adi_link> ... </txp:adi_link>

in:

  • pages
  • forms
  • articles

Examples

Simple link:

<txp:adi_link url="http://www.example.com/" />

- creates link to “http://www.example.com/”, with link text of “www.example.com”

External link:

<txp:adi_link url="www.example.com" ext_link="1"/>

- creates link with HTML attributes: class=“ext_link” & rel=“external”

Link using URL from another source:

<txp:adi_link><txp:custom_field name="link"/></txp:adi_link>

- creates a link from URL stored in a custom field called “link”

Enhance links in an article:

notextile. <txp:adi_link ext_link="1">

* "Link 1":http://www.linkone.com
* "Link 2":http://www.linktwo.com
* "Link 3":http://www.linkthree.com
notextile. </txp:adi_link>

Note: separate adi_link tags from content with blank lines & use “notextile” to prevent empty <p></p> being generated

TXP link:

<txp:adi_link id="23" link_text="New text"/>

- outputs a specific TXP link, overriding the stored link text/title

In a link form:

<txp:adi_link class="myclass" />

- when used in a Link Form, will output link with class of “myclass”

Link to page anchor:

<txp:adi_link anchor="top" link_text="back to top" />

- outputs a link to #top on current page

Link to section with additional URL vars:

<txp:adi_link section="mysection" urlvars="var1=value1&var2=value2" link_text="My Section with extras" />

- outputs a link to section “mysection”, with extra URL vars appended

Article Request Count:
Keywords/tags:
Initially released:
1 sep 2008
Posted here:
01 Sep 2008

You know you want to visit the Archives.
Published with Textpattern