ExpressionEngine 2024 Quarter 1 Review Quarter 1 Review
Hi DV0007, Thanks for getting in touch about this. There are several ways you could do this. The easiest is probably to do something along the following lines
{exp:channel:entries channel="pages"}
{!-- Please note the channel name above will have to be the one you are using --}
{if '{file_field}' != ''}
{!-- This means we have the file field for this entry --}
{file_field}
{if:else}
{!-- open channel entries loop along the following lines ..
I'd generally put this in an embed to keep things clean
If you went that route you would use something like
{emebd="_embeds/page_1_image" entry_id_of_page_1="{passed in entry ID}"}
--}
}
{exp:channel:entries channel="pages" dynamic="no" entry_id="{entry_id_of_page_1}"}
{!-- Please note, the {entry_id_of_page_1} is a placeholder --}
{file_field}
{/exp:channel:entries}
{/if}
{/exp:channel:entries}
Please note, you could also use the url_title or a few other methods to achieve this.
Thanks,
-Tom Jaeger
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.