Feed link
Contents
Syntax
<txp:feed_link>
The feed_link tag can be used as either a single or container tag and is used to output a link to the site’s ‘articles’ RSS feed. When used as a container tag, it will turn the contents into a link to the feed, otherwise the value of label attribute will be used as link text. Should be used in Textpattern Page templates.
Attributes
Tag will accept the following attributes (case-sensitive) as well as the global attributes :
category="category name"- Restrict to articles from specified category/categories. Note: the 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 panel to ensure you are using the correct names.
- Values: (comma separated list of) category name(s).
- Default: current category.
flavor="value"- Whether to output a link to the RSS or Atom version of the feed.
- Values:
rssoratom. - Default:
rss. format="value"v4.0.4+- Whether to output HTML
<a>tag or<link>tag. - Values:
aorlink. - Default:
a. limit="integer"- Number of articles to display in the feed.
- Default: depends upon Preferences panel setting.
section="section name"- Restrict to articles from specified section(s).
- Values: (comma separated list of) section name(s).
- Default: current section.
title="value"- HTML title attribute to be applied to link tag.
- Default: depends upon
flavorused, eitherRSS feedorAtom feed.
Common presentational attributes
These attributes, which affect presentation, are shared by many tags. Note that default values can vary among tags.
class="class name"v4.3.0+- HTML
classto apply to thewraptagattribute value. - Default: tag name or unset (see class cross-reference).
label="text"- Label prepended to item.
- Default: unset (but see label cross-reference for exceptions).
wraptag="element"- HTML element to wrap feed link, specified without brackets (e.g.
wraptag="p"). - Default: unset (but see wraptag cross-reference for exceptions).
Note: wraptag is applicable only when using format of a.
Examples
Example 1: Display an RSS feed link for specific section and category
<txp:feed_link flavor="rss" section="about" category="general" label="XML" wraptag="p" />
Example 2: Container example
<txp:feed_link wraptag="p">
<img src="/path/to/rss-icon.png" alt="RSS">
</txp:feed_link>
Example 3: Site wide generic RSS feed
<txp:feed_link section="" category="" />
Creates a link to the site’s feed for articles in all sections and categories. If you omit the category and section attributes, the feed will default to the current section/category.
Genealogy
Version 4.3.0
class attribute added.
Version 4.0.4
format attribute added.