Use dynamic content to pull a media file from an ACF field

Hi. I’m customizing a Woo product page with Cornerstone and using the Product Tabs element. In one of the tabs, I’d like to pull from one of the ACF fields I’ve set up that’s a File field type – a PDF brochure.

So my question is how I set up that dynamic query. From the dropdown I can pull the contents of a text-based ACF field easily. But for the field where I’ve uploaded the PDF into the product record, that code returns nothing:

<p><a href="{{dc:acf:post_field field="csa-brochure"}}">Download</a> our brochure for this CSA</p>

I’m assuming this is because I need to somehow pull the URL associated with the item, but I don’t see any obvious way to do that from the drop-downs I’m presented. Any ideas? Thanks!

Hello @mgiraud,

Thanks for writing to us.

It seems that you have added the correct dynamic content code to pull the PDF URL, please make sure you have set the ACF field “Return value” as “File URL”

Edit-Field-Group-“port”-‹-Themeco-—-WordPress
If it doesn’t work for you, please share your details in a secure note. Please provide the following details

  • WordPress Login URL
  • Admin-level username and password
  • Exact page URL

You can find the Secure Note button at the bottom of your posts

Thanks

Hello Matt,

To better assist you with the issue, please provide us access so we can double-check your site settings and ACF fields. You can create a secure note in your next reply with the following info:
– Link to your site
– WP login URL
– WP username
– WP password
– WP Administrator Role
– Confirmation that we can access and make changes to your site

To know how to create a secure note, please check this out: How The Forum Works

image

Cheers.

1 Like

Hi. As I mentioned in my previous secure note, I’m currently working locally so I can’t give you access. So this will have to wait until i’m ready to push to my staging server (unless you have a better idea).

Hello Matt,

It would be best if you could make the website online on the staging server so that we can access the site and guide you properly.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.