Texpattern context demo

Current global context
SectionCategoryType
context_demostasisimage

Image-category context

Note: this example has been updated to use image instead of image_display, which has been deprecated as of Txp 4.8.0.

The image-category list in the sidebar is from a category_list tag. Here’s a simplified version:

<txp:category_list type="image" this_section="1" categories="landforms, stasis" />

It produces this output:

Landforms
Stasis

The type attribute is new in Txp 4.3.0. It is available in category_list, category, if_category, and if_author. “Article” is the default type for all these tags. (NB: a couple of other tags also have a type attribute, but it refers to something else.)

And here’s the gallery again, with a new set of images from the new context:

This code:

<txp:if_category type="image">
	<div class="thumbnails"><txp:images limit="5" break="" /></div>
<!-- There's no "if_image" tag, so create one with txp:variable -->
	<txp:variable name="context_image" value='<txp:page_url type="p" />' />
	<txp:if_variable name="context_image" value=""><txp:else />
		<p><txp:image /></p>
	</txp:if_variable>
</txp:if_category>

produces this output: