0

I have a grid field (files), with a column/variable (file). I just need to display my content/snippet if a file has been uploaded.

So something like:

{if files:file}link to my file{/if}

Any help is appreciated.

0
1

Do it exactly like you think.

{my_grid_field} {if my_grid_field:column}{my_grid_field:column}{/if} {/my_grid_field}

1
  • Thank you for this! I was trying to get it to work by displaying a snippet, but for some reason that does work: {if files:file}{my_snippet}{/if}. Is it not possible? – ZEDG May 27 '15 at 20:35
0

I worked this out by doing this

{if files}{my_snippet}{/if}

And then in my snippet

{files}
<a href="{files:file}">{files:file_name}</a>
{/files}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.