Go to main content

Image index

Deprecated in Textpattern 4.7.0 (use the images tag instead)

Contents

Syntax

<txp:image_index />

The image_index tag is a single tag that is intended to be used in tandem with image_display. It renders thumbnails of all images contained in an image category. This category can be specified as an attribute to the tag and defaults to the current site category as given in the page’s URL.

The thumbnail images are linked to an address which will pass the image ID plus the active category on to the tandem image_display tag. It is up to the user to include this tandem tag at an appropriate place inside the page template.

Note: As the image category is passed into image_display, it requires to either place the ‘receiving’ image_display on an article independent portion of the page (i.e. outside of the article form), or otherwise both the article used for display and the images have to share a ‘common’ category.

Attributes

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

category="category name"
Category of images to display.
Values: (comma separated list of) category name(s).
Default: presently viewed category.
limit="integer"
The number of images to display.
Default: 0 (no limit).
offset="integer"
The number of images to skip.
Default: 0.
sort="sort value(s)"
How to sort the resulting image list. Specify a value from the ones below, followed by a space and then add either asc or desc to sort in ascending or descending order, respectively.
Values:
alt (image alt text).
author.
caption (image caption text).
category (image category).
date (date posted).
ext (image extension).
h (image height).
id (image id#).
name (image name).
rand() (random).
thumbnail.
w (image width).
Each field in the txp_image database table can be used as a sort key.
Default: name asc.

Common presentational attributes

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

break="value"
Where value is an HTML element, specified without brackets (e.g. break="li") or some string to separate list items.
Default: br (but see break cross-reference for exceptions).
breakby="integer" v4.7.0+
Used to group list items when separating by break. Possible values are lists of integers, like 2 (groups of 2 items) or 1,2 (alternate groups of 1 and 2 items).
Default: 1 (actually unset).
class="class name"
HTML class to apply to the wraptag attribute 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).
labeltag="element"
HTML element to wrap (markup) label, specified without brackets (e.g. labeltag="h3").
Default: unset.
wraptag="element"
HTML element to wrap (markup) list block, specified without brackets (e.g. wraptag="ul").
Default: unset (but see wraptag cross-reference for exceptions).

Examples

Example 1: Create a list of images in a category

<txp:image_index category="personal" wraptag="ol" break="li" />
<txp:image_display />

Shows the thumbnail images from the category ‘personal’.

Other tags used: image_display.

Genealogy

Version 4.7.0

breakby attribute added.
Tag support removed - use images tag instead.

Version 4.3.0

c attribute deprecated and renamed category.

If you notice any kind of problem with this page's construction or content (outdated information, typos, broken links, or whatever), open an issue to have it sorted. Or have a go at it yourself. :)