You are here: Home :: Forum Home :: Modules :: Channel Files :: Thread
I’m trying to do the following. The library_files is a Playa field. But the file_category tag is not being processed. But all the others work OK. It’s just returning “{file_category}” literally. This happens regardless of whether or not I try to use it in the if statement is in this code.
{library_files}
{if '{count}' == '1'}<div class="bibliography">{/if}
{exp:channel_files:files entry_id="{entry_id}"}
{if "{file_category}"=="wav" OR "{file_category}"=="mp3" OR "{file_category}"=="audio"}
<p><a class="media" href="{file_url}" target="_blank" alt="{file_title}" title="{file_title}">{file_title}</a></p>
{if:else}
<p><a href="{file_url}" target="_blank" alt="{file_title}" title="{file_title}">{file_title}</a></p>
{/if}
{/exp:channel_files:files}
{if '{count}' == '{total_related_entries}'}</div>{/if}
{/library_files}
Can you try:
{category}
See what you get, this could be a mistake in the docs.
Brad
Instead of
{file_category}
Brad
Yep, that solved it. The variable is incorrectly named in the documentation.
Thanks Brad.