All Collections
Tutorials
How to Create a Button to an ACF field File with Dynamic Tag - Token
How to Create a Button to an ACF field File with Dynamic Tag - Token
Updated over a week ago

In order to use the ACF field type File in your Elementor Page, you can use our tokens.

There are three ways you can return the value:

  • File Array

  • File URL

  • File ID


1. File Array

When the return value is the array you can access the data such as url as well as the filename with tokens

Use Token [acf:file_field:url] to return the file URL

Use Token [acf:file_field:filename] to return the filename


2. File URL

When the return value is the File URL, it will simply return the file URL.

Use Token [acf:file_field] to return the URL


3. File ID

When the return value is File ID, it will return the file ID on the normal output.

Use Token [acf:file_field] to return the file ID

Use Token [acf:file_field|wp_get_attachment_url] to return the URL


Using the Link on a Button

Now you can use the token in the button link URL field.

In order to let the users directly download the file without opening it, you can use the custom attribute "download"

Did this answer your question?