From 7748d8f132ff10fd44c6d7fe50fb9224f1c4392b Mon Sep 17 00:00:00 2001 From: Travis 'Nep' Smith Date: Tue, 7 Oct 2025 22:27:06 -0500 Subject: [PATCH] Update file.md Added example of conditional. --- docs/fieldtypes/file.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/fieldtypes/file.md b/docs/fieldtypes/file.md index a244d3c3..b1a73563 100755 --- a/docs/fieldtypes/file.md +++ b/docs/fieldtypes/file.md @@ -58,6 +58,16 @@ If you have defined any [image manipulations](control-panel/file-manager/upload- {news_image:small} +### Conditional Content Check + +If you want to see if there is a file selected, the easiest method is to check for the file URL: + + {if news_image == ""}There is no news image selected.{/if} + +or even + + {if news_image}File URL: {news_image}{/if} + ### Wrap Parameter You will frequently want to link to the file in your entry. Using the wrap parameter can simplify this process: