Contents
Overview
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.
Quick Start
- To see if a field is present or not and output conditional content on whether it has a value, use
[if field_name][else][/if]
- To loop through Relationship fields, Taxonomy terms or Multiple image/media fields, use
[each related_field_name][/each]
. Remember don’t include therelated_field_name
in front of any magic tags inside the each loop. - To limit output in template to only the beginning of output (like for
ul
,ol
ortable
heads) use[before][/before]
and subsequently[after][/after]
at the ending portion.