On this page:


<txp:thumbnail />

The thumbnail tag is a single tag that Textpattern will replace with the <img src="…"> HTML tag matching the thumbnail image of the numeric id assigned by Textpattern when the parent image was uploaded via the Textpattern Images panel.

By default, the tag is context-sensitive: if an id or name attribute is not specified, it can be used inside an images tag or form to output an <img src="…"> HTML tag matching the thumbnail of the current image.


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

escape="html" v4.0.4+
Escape HTML entities such as <, > and & for the image’s alt and title attributes.
Values: See the tag escaping documentation for all possible values.
Default: html.
Specify an image height which overrides the value stored in the database. Use height="0" to turn off the output of a width attribute in the <img> tag (thus the browser will scale the height if a width is used).
html_id="id" v4.0.4+
The HTML id attribute assigned to the image (or to the wraptag, if set).
Default: unset.
Specifies the id assigned at upload of the image to display. Can be found on the Textpattern Images panel. If both name and id are specified, name is used while id is ignored. If neither is specified, the tag must be used within an images tag or form.
link="boolean" v4.0.6+
If set, the thumbnail will be rendered as a (non-Javascript) URL link to the full-size image.
Values: 0 (no) or 1 (yes).
Default: 0.
link_rel="relation" v4.0.6+
Value for the HTML rel attribute.
Default: unset.
name="image name"
Specifies which image thumbnail to display by its image name as shown on the Textpattern Images panel.
poplink="boolean" (Deprecated from version 4.7.0)
If set, the image will be rendered in a popup window.
Values: 0 (no) or 1 (yes).
Default: 0.
Specify an image width which overrides the value stored in the database. Use width="0" to turn off the output of a width attribute in the <img> tag (thus the browser will scale the width if a height is used).

Common presentational attributes

These attributes, which affect presentation, are shared by many tags. Note that default values can vary among tags.

class="class name"
HTML class to apply to the wraptag attribute value, if set, otherwise to the <img> tag.
Default: unset (see class cross-reference).
style="style rule"
Inline CSS style rule. It’s recommended that you assign CSS rules via class attribute instead.
Default: unset.
wraptag="element" v4.0.4+
HTML tag to be used to wrap the <img> tag, specified without brackets (e.g. wraptag="p").
Default: unset (but see wraptag cross-reference for exceptions).


Example 1: Display the given thumbnail

<txp:thumbnail id="23" />

Displays the image thumbnail for the image uploaded as ID #23.

Example 2: Use within images tag

    <txp:thumbnail />

Displays thumbnails for all images found by the images tag.


Version 4.7.0

poplink attribute deprecated.

Version 4.3.0

Added context sensitivity within images tag.

Version 4.2.0

align attribute deprecated.

Version 4.0.7

Default value for escape attribute changed from ‘unset’ to html.

Version 4.0.6

link and link_rel attributes added.

Version 4.0.4

escape, html_id and wraptag attributes added.

See something wrong in this document? Outdated info, a broken link, faulty code example, or whatever? Please open an issue and we’ll investigate.