hop to #bottom


Content informed conditional

Conditionally generate output depending on whether any of the enclosed tags generate content.


Avoid hazardous indexing

How to prevent indexing a test site and to serve (or not) content according to a given production status.


Serve content to EU visitors only

A conditional container tag to serve content to EU visitors only (e.g. a cookie-prompt: see usage notes below) or non-EU visitors (via <txp:else />) tag.


Detect Mobile Browser

Option 1:

<txp:pro_mobile> // Show mobile content here </txp:pro_mobile>

Option 2:

Use as an if/else:

<txp:pro_mobile> // Mobile content here <txp:else /> // Regular content here </txp:pro_mobile>

Option 3:

Define custom...


Apply wraptag / label to any tag, plugin or content and apply transformations to the data

Wrap any content with standard Txp wraptag / class / html_id / label items and run the content through a sequence of transformations in the process. If the content is empty, no wrap is performed or the <txp:else /> is executed.


Extends if_variable abilities

Treat your variables as strings or lists and compare them to strings or lists. A combination of if_variable and if_custom_field.

Main tag

  • cbe_if_variable

Two bonus...


Tests if an article is already released, or will be in the future

Take appropriate action when an article is published, or not yet.


Mobile browser detection

adi_mobile implements mobile browser detection, together with some website mode switch functionality and viewport measurement.

See the help supplied with the plugin, or have a look


Conditional tags for forms

Lately, I’ve been writing Textpattern pages for relatively complex sites that do things like this:

<txp:if_section name="widgets,sprockets,thingies">
    <txp:hide>The widgets, sprockets, and thingies sections have their own special layouts.</txp:hide>



Since dub_if_ajax is no longer up for grabs: here’s jdw_if_ajax .

This plugin is based off dub_if_ajax (no longer available) by Jamie Wilkinson. It uses the x-requested-with header to deliver different content to Ajax calls.

Addition of a new tag: jdw_if_not_ajax.


Container tag. When the...
All 1085 articles are stored in the treasure rooms that are the Archives.
Published with Textpattern