I have a template where I need to check whether an entry has related entries data. Normally, I would just use the {if no_related_entries} tag, but in this case, it won’t work.
If my main entry has a related entry, I need to output the {entry_id} of the related entry. If my main entry has no related entry, I need to output the {entry_id} of the main entry.
I tried this first, and it didn’t work:
{related_entries id="problem"}{entry_id}{if no_related_entries}{entry_id}{/if}{/related_entries}and I tried this:
{if problem == ""}{entry_id}{/if}
{if problem != ""}{related_entries id="problem"}{entry_id}{/related_entries}{/if}That didn’t work either. Is there a way to accomplish what I’m trying to do?