I've got a situation where I'm pulling a list of channel entries, each of which link to a page with more details. The channel is called "audio", and it contains a Channel Files field that can hold multiple audio files.
What I would like to do is this:
- If the entry contains just one audio file, do ABC.
- If the entry contains more than one audio file, do XYZ
Here is my "dumbed-down" code
{exp:channel:entries channel="teleconferences"}
{exp:channel_files:files entry_id="{entry_id}" limit="1"}
<p><a href="/{segment_1}/{url_title}">Full Details</a></p>
{/exp:channel_files:files}
{/exp:channel_files:files}
If I don't put a limit on the {exp:channel:entries" tag, then it prints a link for the total number of files in the entry. So if there were 5 files in Entry A, and 1 in Entry B, it would look like this:
- Entry A
- Entry A
- Entry A
- Entry A
- Entry A
- Entry B
If I do put a limit, then I get that number per page, with pagination.
If I add a limit to the {exp:channel_files:files} tag, then I only get one entry, but I'm unable to do ABC or XYZ on it. Basically, what I'd like to do is put a play button if there is only one audio file, or a link to the page if there are multiple audio files.
Perhaps this isn't doable but I thought I would ask the experts!!