Great Ocean Media

website design - editorial & pr services - freelance journalism

  • Home
  • Services
    • Services Overview
    • Website Design
    • Press Releases
    • Newsletters
    • Editorial & PR
    • Freelance Journalism
    • Proofreading
  • Portfolio
    • Portfolio Overview
    • Websites
    • Newsletters
    • Press Releases
  • About us

adi_link – Enhanced links

This plugin provides a new tag, <txp:adi_link />, which will output links from various sources, with custom attributes.

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

Attributes

html_id="html id"

- the HTML ID applied to the link. Default = “” (no ID).

class="class name"

- CSS class applied to the link. Default = “” (no class).

url="url"

- URL (with or without “http://” prefix) used for link. Default = “” (URL taken from some other source).

link_text="text"

- text to be used for link. Default = “” (use URL). Will override value from database when used with TXP link id.

title="text"

- text to be used for HTML title attribute. Default = “” (use link text).

pretty_url="boolean"

- strip “http://” prefix & trailing slash from URL. Default = “1” (Yes). For use when link_text attribute not specified.

ext_link="boolean"

- specifies whether the link should be rendered as an “external” link or not – see ext_class & rel_name. Default = “0” (No).

ext_class="class name"

- CSS class applied to the link if ext_link=1. Default = “ext_link”.

rel_name="rel name"

- value for the HTML rel attribute. Default = “bookmark” (or “external” if ext_link=“1”).

escape="html"

- escape HTML entities in link text & link title. Default = “html” (Yes).

single_url="boolean"

- force single URL mode. Default = “0” (No). For use in container tag mode when enclosing a URL that doesn’t have “http://” prefix.

id="link ID number"

- display specific TXP link.

url_link_text="boolean"

- use URL for the link text. Default = “0” (No). For use with TXP links, as normally the stored link name/title is displayed.

suppress_href="boolean"

- suppress output of the href attribute. Default = “0” (No).

section="section name"

- output link to specified section. Default = not used. For current section, use section="".

anchor="page anchor"

- output link with page anchor. Default = “” (not used). If no URL or section specified then link to current page used.

urlvars="URL variables"

- append some URL vars. Default = “” (none). For example urlvars="var1=value1&var2=value2".

category="category name"

- output link with specified category. Default = “” (No category).

Additional information

Support and further information can be obtained from the Textpattern support forum. A copy of this help is also available online. More adi_plugins can be found here.

Version 0.2 - Download Support

  • Links:
  • All plugins
  • adi_calc
  • adi_cat_menu
  • adi_contact
  • adi_gps
  • adi_link
  • adi_menu
  • adi_notes
  • adi_title
  • adi_variables
  • adi_wrap
Great Ocean Media contact details QR Code
W3CHTML 4.01 W3CValid CSS PHPPowered Madeon a Mac

capture our contact details

Adi Gilbert © Great Ocean Media 2010
Email: info[at]greatoceanmedia[dot]com[dot]au
Phone: 03 5237 3176 (office), 0439 484250 (mobile)
Links: Feedback, Copyright, Privacy, Disclaimer
Textpattern: Plugins