Skip Navigation

[Resolved] Dynamic download button is not offering to link custom field “file”

This thread is resolved. Here is a description of the problem and solution.

Problem:

The issue here is that the user is unable to specify a file field as a link for the dynamic button block

Solution:

This is a known issue by our developers and they are working to resolve the issue. This fix should be available in a future release

This support ticket is created 3 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 4 replies, has 2 voices.

Last updated by andreasK-15 3 years ago.

Assisted by: Shane.

Author
Posts
#1981001

Tell us what you are trying to do?
I want to add a download button on my custom template, so users can download a pdf file for each custom post. I added a button, selected "dynamic button URL", I can select my custom fields group, but after that I can only select custom fields (e.g. for images, and videos) but not for the file custom field "file", which contains the PDF. Any ideas?
Is there any documentation that you are following?
standard Toolset documentation
Is there a similar example that we can see?

What is the link to your site?

#1981083

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Andreas,

Thank you for getting in touch.

It would appear that file fields are not supported as a Dynamic URL option for the Buttons Block. I See on our system that a ticket was created for this and our development team has already addressed the issue. You will be able to use file fields as a Dynamic URL option in a future release.

However a workaround to this is that you can manually add the shortcode to your template inside an anchor tag and then style that anchor tag to appear as a button.
Have a look at the link below.
hidden link

An example of how you will format the anchor tag with the shortcode for your file field would be.

<a href="[types field='my-url' output='url'][/types]">Download </a>

Where you will replace 'my-url' with the slug of your url field.

Please let me know if this helps.
Thanks,
Shane

#1982983
Screen Shot 2021-03-12 at 7.12.07 am.png
Screen Shot 2021-03-12 at 7.11.58 am.png

Thanks Shane, much appreciated! Could you please have a look at the following? I think, I'm doing sth wrong as the output is not as expected. Many thanks and kind regards, Andreas

#1983065

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Andreas,

Thank you can you change the output='url' to output='raw' so the final code should be.

<a href="[types field='my-url' output='raw'][/types]">Download </a>

Let me know if this produces the correct results now.
Thanks,
Shane

#1983727

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.