Problem: I would like to display a link to download a file stored in a custom field. That link should open a new tab in the same window, and should show an icon instead of the file name. Ideally, the icon would change depending on the file type.
Solution:
The variable file type icon is not a built-in feature of Toolset, and would require your own custom code. However the rest of the link could be constructed like so:
<a href="[types field='your-field-slug' output='raw'][/types]" target="_blank"><img src="path/to/icon.png" /></a>
Relevant Documentation: https://toolset.com/documentation/customizing-sites-using-php/functions/#file
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 |
---|---|---|---|---|---|---|
8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | - | - |
13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | - | - |
Supporter timezone: America/New_York (GMT-04:00)
This topic contains 2 replies, has 2 voices.
Last updated by theW 6 years, 7 months ago.
Assisted by: Christian Cox.