permlink
From Textpattern CMS User Documentation
<txp:permlink>
The permlink can be used as a single tag or a container tag to return the permanent url of the article being displayed.
If used as a container tag, the HTML required to output a hyperlink is returned; if used as a single tag, only the url itself is returned.
Contents |
Attributes
Tag will accept the following attributes (case-sensitive):
- class="class name"
- CSS class attribute.
- Default: unset.
- id="article id"
- The article ID to link.
- Default: unset (current article).
- style="style rule"
- Inline CSS style definition. Recommended that you use CSS via
classattribute instead. - Default: unset.
- title="text"
- HTML title attribute.
- Default: unset.
Examples
Example 1: Container tag
<txp:permlink><txp:title /></txp:permlink>
would result in:
<a rel="bookmark" href="http://example.com/index.php?id=2">Article title</a>
Other tags used: title
Example 2: Single Tag
<txp:permlink />
would result in something like:
http://example.com/index.php?id=2
Example 3: Customizing Permanent Links
By default permlink returns only a very basic link, which doesn't allow for customizing the link title, or adding a CSS class, etc. Using the tag in its single tag capacity opens up a lot more possibilities.
For example, to have the permanent link have an HTML title attribute of the article's title, and also apply a class to it named "orange":
<a href="<txp:permlink />" title="<txp:title />" class="orange"><txp:title /></a>
Other tags used: title




