You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m working with a Pods template for a custom post type (tleg_song) that includes a relationship field (stage_name) to link an artist. I'm trying to conditionally display social media icons for the artist's various profiles (like Instagram, Facebook, etc.), but the conditional if statements don’t seem to work as expected. When I remove the if condition, the values display correctly, so the fields do contain valid data. However, with the if condition, no output is generated.
What I've Tried:
Without the if statement, the links work and output the correct values, e.g.: <a href="{@stage_name.instagram}" target="_blank">Instagram</a>
This works perfectly and the values are outputted.
When using the if conditional to check if the field exists, no output is generated. I’ve tried several variations, such as:
Also tested with compare="NOT EMPTY" and compare="EXISTS", but nothing seems to work.
Expected Behavior:
The expected behavior is that when a field (e.g., Instagram) is not empty, the relevant social media link should be displayed. If the field is empty, no link or icon should be shown.
Actual Behavior:
When using the if statement, no output is shown, even though the fields contain valid data. Without the if condition, the URLs display correctly.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I’m working with a Pods template for a custom post type (tleg_song) that includes a relationship field (stage_name) to link an artist. I'm trying to conditionally display social media icons for the artist's various profiles (like Instagram, Facebook, etc.), but the conditional if statements don’t seem to work as expected. When I remove the if condition, the values display correctly, so the fields do contain valid data. However, with the if condition, no output is generated.
Here’s the template I’m using:
What I've Tried:
Without the if statement, the links work and output the correct values, e.g.:
<a href="{@stage_name.instagram}" target="_blank">Instagram</a>
This works perfectly and the values are outputted.
When using the if conditional to check if the field exists, no output is generated. I’ve tried several variations, such as:
Also tested with compare="NOT EMPTY" and compare="EXISTS", but nothing seems to work.
Expected Behavior:
The expected behavior is that when a field (e.g., Instagram) is not empty, the relevant social media link should be displayed. If the field is empty, no link or icon should be shown.
Actual Behavior:
When using the if statement, no output is shown, even though the fields contain valid data. Without the if condition, the URLs display correctly.
Beta Was this translation helpful? Give feedback.
All reactions