Textpattern CMS Template Tags

<txp:linklist /> sing/cont tag, 9 attributes

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>

attributes

category="unset" 
  • 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
author="unset" 
  • Restrict to links with the specified author.
realname="unset" 
  • Restrict to links with the specified author name.
sort="linksort asc" 
  • Values
    • id
    • linkname
    • url
    • description
    • category
    • date
    • linksort
    • rand() (random)
  • Direction
    • asc (ascending)
    • desc (descending)
limit="0" (integer)
  • Number of links to display.
offset="0" (integer) 
  • The number of links to skip.
pageby="unset" 
  • Number of links to jump each page. Without this attribute, you cannot navigate using the newer and [older]] tags. Usually you will want to track the limit attribute. Use pageby=“limit” to do this, which means you will not have to amend two values if you subsequently decide to alter the limit
form="plainlinks" 
  • Use specified form.
auto_detect="category, author" 
  • List of Textpattern contexts to consider when automatically searching for links. If you wish to turn off the automatic check, set this to auto_detect=”“. You can choose from the following contexts:
    • category to look in the URL for a category list
    • author to look in the URL for an author list

presentation

label="unset" 
  • Label prepended to item (or as first list item, where appropriate).
    if wraptag is available and is set to ol or ul, the label will be the first list item.
labeltag="unset" 
  • (X)HTML tag (without brackets) to wrap around label.
break="unset" 
  • (X)HTML tag (without brackets) or string to separate list items.
wraptag="unset" 
  • (X)HTML tag (without brackets) to wrap around the list.
class="linklist" 
  • (X)HTML class attribute to apply to the wraptag.

genealogy

Version 4.3.0

  • pageby attribute added to enable paging via newer and older
  • author and realname attributes added
  • auto_detect added to allow automatic (URL-based) contextual listings

Version 4.0.7

  • Can be used as a container tag.

Version 4.0.6

  • support added for comma separated list for category attribute
<txp:linklist /> 3 examples

List of links from specified category

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

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

Links Form (default Links)

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

The form is repeated for each link provided by linklist.