To make working with Pods Templates easier, we’ve made several Conditional tags available to make it easier to create the output you’re looking for in your Pods Templates. As PHP is deprecated in Pods Templates as of Pods 2.4, the focus was to provide some Advanced Markup options using conditional tags. These new tags are defined below and provide utility for expanding relationship fields and conditionally showing content.
- To see if a field is present or not and output conditional content on whether it has a value, use
- To loop through Relationship fields, Taxonomy terms or Multiple image/media fields, use
[each related_field_name][/each]. Remember don’t include the
related_field_namein front of any magic tags inside the each loop.
- To limit output in template to only the beginning of output (like for
[after][/after]at the ending portion.
More Documentation on this Topic
EACH Loop Tag
Provides easy looping through related entries (from relationship fields), taxonomies and media upload fields within Pods Templates.
IF Conditional Tag
Provides simple conditional logic for your Pods Templates
BEFORE and AFTER
Provides the ability to run a opening block in your template that will be output BEFORE and AFTER the loop.
ONCE Template Tag
DO NOT USE. This Tag has been deprecated. Use CSS with nth positioning :first if you need this functionality.
Example Template Tag Usage
Examples of Pods Templates using a mixture of tags