<txp:wet_link>
creates links. It works as a replacement for txp:permlink, and it can also be used to create direct links to articles, pages, images, article lists, and external web sites.
Some examples:
<txp:wet_link>foo</txp:wet_link>
In an article form, works the same as txp:permlink
<txp:wet_link title="permanent link to '%s'">foo</txp:wet_link>
Same as txp:permlink, except with a title attribute. The optional ‘%s’ will be replaced with the article title.
<txp:wet_link href="25">foo</txp:wet_link>
Direct link to article #25. If a ‘title’ attribute is supplied, it works the same as for a permanent link, with ‘%s’ replaced with the article title.
<txp:wet_link href="foo/">foo</txp:wet_link>
Creates a link relative to the textpattern root.
<txp:wet_link linkid="15">foo</txp:wet_link>
Direct link to link #15. If no ‘title’ attribute is supplied, the link description field is used.
<txp:wet_link image="15">foo</txp:wet_link>
Direct link to image #15. If no ‘title’ attribute is supplied, the image caption field is used.
As of version 0.3, it is possible to use wet_link as a self-closing tag in certain circumstances:
<txp:wet_link href="25" />
Direct link to article #25. The article title will be used as the link text.
<txp:wet_link linkid="15" />
Direct link to link #15. The link name field will be used as the link text.
As of version 0.4, it is possible to use wet_link as a link to article lists:
<txp:wet_link section="about">About Us</txp:wet_link>
Link to the section named “about”. Differing from<txp:section />
, this tag will include the enclosed text as a link.
<txp:wet_link category="apples">Apples galore</txp:wet_link>
Link to the category named “apples”.
<txp:wet_link author="eve">All articles by Eve</txp:wet_link>
Link to a list of Eve’s articles.
All of the above forms support the following attributes:
attribute | description |
---|---|
href | the URL or article ID, as described above. |
linkid | the link ID, as described above. |
section | a section’s name to link to. |
category | a category’s name to link to. |
author | an author’s name to link to. |
image | an image’s id to link to. |
class | CSS class name. Optional. |
target | link target. Optional. |
title | link title. Optional. ‘%s’ may be used in links to article and link IDs, to include the article title or link description. |
rel | link attribute “rel”. Optional. |
id | link atribute “id”. Optional. |
name | link attribute “name”. Optional. |
accesskey | link attribute “accesskey”. Optional. |
no_widow | Suppress widows in titles. Optional. |
Either href, image, linkid or section, author, and category are mutually exclusive.
Largely based upon zem_link. Thanks, Alex!