Textpattern logo

Help?

linklist

From Textbook

<txp:linklist />

The linklist tag is a single or a container tag which is used to produce a list of links from the predefined list created on the Links tab.

If used as a container, it must be specified as an opening and closing pair of tags, like this:

<txp:linklist>
...contained statements...
</txp:linklist>

Contents

Attributes

Tag will accept the following attributes (case-sensitive):

category="category name(s)"
Restrict to links from specified category/ies.
Values: (comma separated list of) category name(s). Note: category names may be different to the Title you typed when you created the category, as the names are sanitized for URL use. Check the Categories tab to ensure you are using the correct names
Default: unset.
sort="sort value(s)"
How to sort the resulting list.
Values: id, linkname, url, description, category, date, linksort, rand() (random).
Default: linksort asc.
limit="integer"
Number of links to display.
Default: 0 (no limit).
offset="integer"
The number of links to skip.
Default: 0.
form="form name"
Use specified form.
Default: plainlinks.
label="text"
Label for the top of the list.
Default: unset.
labeltag="tag"
(X)HTML tag (without brackets) to wrap around label.
Default: unset.
wraptag="tag"
(X)HTML tag (without brackets) to wrap around list.
Default: unset.
break="value"
(X)HTML tag (without brackets) or string used to separate list items.
Default: unset.
class="class name"
(X)HTML class attribute to be applied to wraptag.
Default: linklist.

Examples

Example 1: List of links from specified category

<txp:linklist form="Links" category="general" limit="10" sort="linksort" wraptag="p" />

Example 2: Links as a selectable ordered list

This example uses the displayed page's category as the criterion for choosing the linklist's category.

<txp:if_category name="100">
<txp:linklist label="First Floor" category="First" wraptag="ol" break="li" />
</txp:if_category>
<txp:if_category name="200">
<txp:linklist label="Second Floor" category="Second" wraptag="ol" break="li" />
</txp:if_category>

Other tags used: if_category

Example 3: Links Form (default Links)

<txp:link /><br />
<txp:link_description /><br />
<txp:linkdesctitle />

The form is repeated for each link provided by linklist.

Genealogy

Version 4.0.7

  • Can be used as a container tag.

Version 4.0.6

  • support added for comma separated list for category attribute

Translations [?]...

About Textbook