<txp:image_info /> single tag, 8 attributes


The image_info tag is a single tag that Textpattern will replace with the relevant image data from the current image. Should usually be used in an image form, although it may be used on its own providing you specify an id or name.


id="unset" (integer) 
  • An id assigned at upload of an image to display. The IDs can be found on the Images tab.
  • An image to display, given by its image name as shown on the Images tab. If both name and id are specified, the id takes precedence.
  • Values to display information from the current image:
    • id
    • name
    • category
    • category_title
    • alt
    • caption
    • ext (image extension)
    • author (login name: see image_author to display the author’s real name)
    • w (image width)
    • h (image height)
    • thumb_w (image thumbnail width)
    • thumb_h (image thumbnail height)
    • date (timestamp of image upload: this is not very useful so consult image_date for a better alternative)
  • (X)HTML tag to wrap the items grabbed from the type attribute, specified without brackets.
  • CSS class attribute applied to the wraptag.
  • The (X)HTML tag (without brackets) or string to separate each type item.
  • CSS class attribute applied to each break tag.
  • Escape HTML entities such as <, > and & for the given types.
  • Values: html or unset.


Version 4.3.0

  • tag introduced
<txp:image_info /> 3 examples

Gallery thumbnail and caption

<txp:images category="mammals">
  <txp:thumbnail />
  <txp:image_info type="caption" wraptag="div" class="img_cap" />

What it does…
Grabs all images from the mammals category and displays the image thumbnail itself along with the image caption surrounded with <div class=“img_cap”>…</div> tags. Note that the image IDs/names are not specified inside the container because they are automatically assigned from the <txp:images> tag for each image in the given category.

Other tags used: images, thumbnail

Multiple pieces of information at once

<txp:images category="birds, mammals" thumbnail="1" sort="category asc">
    <h4><txp:image_info type="category_title" /></h4>
  <txp:thumbnail wraptag="div" />
  <txp:image_info type="w, h" wraptag="div" class="img_dims" break=" x " />
  by <txp:image_info type="author" />

What it does…
Shows the thumbnail of each image that has an assigned thumbnail image from the mammals and birds categories and, beneath each, show its dimensions width x height along with the author of the image. Since the list has been sorted by category, the <txp:if_different> conditional can be used to output the category title at the top of the list of images each time it changes.

Other tags used: images, thumbnail, if_different

Specific image information

<txp:image_info id="5" type="category_title" /> 

What it does
Displays the category_title of the category assigned to image ID 5.