Skip Navigation

[Resolved] PDF and DOCS automatic link generation

This support ticket is created 4 years, 2 months 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
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 1 reply, has 2 voices.

Last updated by Christian Cox 4 years, 2 months ago.

Assisted by: Christian Cox.

Author
Posts
#2079599

My custom posts are generated via gravity forms, I want to display pdfs and docs i upload with the form on the post. Is there a way to do this I've been looking everywhere

#2079747
Screen Shot 2021-06-07 at 4.35.58 PM.png
Screen Shot 2021-06-07 at 4.36.07 PM.png
Screen Shot 2021-06-07 at 4.39.14 PM.png

Hello, I'm not a Gravity Forms expert so I'm not really the best source of information about their system. I'm not sure how this information is saved with the post, or if they offer a special shortcode or API for displaying that information in a post template. This document seems to indicate you can use their Views feature to display links to these files:
https://docs.gravityview.co/article/629-display-uploaded-files-as-links

That doesn't really help you display the links in a Toolset Content Template, though. If the document or file URL is saved as a standard custom field value, then you can use the Views shortcode wpv-post-field to display a link to that file URL if you know the custom field slug. You can place that shortcode in your post's Content Template in a paragraph block or custom HTML block, to display the raw custom field value:

[wpv-post-field name='field-slug']

Replace field-slug with the slug of the custom field holding the file URL. Or you could create a download link using some custom HTML:

<a href="[wpv-post-field name='field-slug']" download>Download file</a>

https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-post-field

If the upload file information is saved in a custom field, you should be able to find the file URL in the post editor screen when you turn on the native custom field panel. In the Block Editor, you can turn on the custom field panel by clicking the 3-dot icon in the top right corner and then opening Preferences (screenshots attached here). In the Panel tab of the Preferences dialog, you can turn on the Custom Field panel to inspect all the custom fields for this post. If the file URL is saved in one of these custom fields, use the field name (slug) in the wpv-post-field shortcode as shown in the examples above. If the file URL is not saved in one of the custom fields, you may need to contact Gravity Forms support for more information about how to display links to those uploads using shortcodes. It may require a custom code snippet to save those uploaded document URLs in some custom fields, I'm not sure though.