Title: Displaying file field
Last modified: July 19, 2024

---

# Displaying file field

 *  Resolved [kaostc](https://wordpress.org/support/users/kaostc/)
 * (@kaostc)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/displaying-file-field/)
 * I have a pod with a file field that returns the id of the uploaded file.
 * I want this field to be shown as a DIVI button that download the file. So I select
   the pod file field in link property of DIVI button. The problem is that pod fields
   return the id, not the permalink of the file, so it does not work. It is possible
   to (kind of) cast the field to return the permalink instead of id?
 * Thanks a lot!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fdisplaying-file-field%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [complexe](https://wordpress.org/support/users/complexe/)
 * (@complexe)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/displaying-file-field/#post-17907030)
 * I would also love some help with this. While I am using GenerateBlocks and its
   dynamic data, it appears to be the same issue.
 * The[ documentation ](https://docs.pods.io/fields/file/)for the Files field suggests
   that **“By default, Pods will not link to the file URL when displaying.”**
 * Is there a way to change this default behavior for use with DIVI/Generate Blocks/
   Query Loops, and without using templates and short codes?
 *  Thread Starter [kaostc](https://wordpress.org/support/users/kaostc/)
 * (@kaostc)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/displaying-file-field/#post-17917553)
 * Hi [@complexe](https://wordpress.org/support/users/complexe/) , I found a workaround
   to use the url of a file in a button module link, I share it in case it suitable
   for you also:
   1. Creating a text module with the magic tag that Yousef shared
   above.`[pods name="project" use_current="1"] <span id="enlace-boton">{@doc_principal_proyecto.
   _src}</span>[/pods]
    2. Hiding this text module (but using custom CSS, not by module controls, in other
       case it won’t work)
    3. Creating a code module, with a jQuery snippet that copies the link from the 
       text to the button link:
 *     ```wp-block-code
       <script>  $(document).ready(function(){    $("#boton-documento").attr("href", $("#enlace-boton").text())  });</script>
       ```
   
 *  Plugin Support [pdclark](https://wordpress.org/support/users/pdclark/)
 * (@pdclark)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/displaying-file-field/#post-17956134)
 * Workarounds like the one posted by [@kaostc](https://wordpress.org/support/users/kaostc/)
   above are necessary when working with third-party user interfaces such as Divi,
   GenerateBlocks, Elementor, and others because the authors of those interfaces
   decide what data gets associated with the menu items.
 * **Page Builders with user interfaces closely associated to templates**
 * Because each of those editors closely associates the presented menus with the
   stylization of their templates, it’s not usually simple to change their behavior
   unless those developers provide filters.
 * **Working around by editing after the page renders**
 * The solution provided works around the challenge by outputting the value from
   Pods in plain HTML, then using JavaScript to take a value from that custom HTML
   and attach it to the builder output after the page renders.
 * **Alternative workarounds**
 * When an existing template, page builder, plugin, or theme outputs highly customized
   templates that don’t integrate with custom data structures as intended, workaround
   almost always involve one of these:
    - Check third-party plugin code or documentation for PHP filters, such as `apply_filters()`
      to modify data.
    - Modify HTML output with JavaScript, as above.
    - Modify HTML output with PHP, such as with `ob_start()` and DOM functions. 
      This is necessary over JavaScript if the content matters for search engines
      or other non-JavaScript-enabled visitors.
 * **Attachment ID to URL**
 * The WordPress function for getting an attachment URL from the attachment ID is
   [wp_get_attachment_url()](https://developer.wordpress.org/reference/functions/wp_get_attachment_url/)

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Displaying file field’ is closed to new replies.

 * ![](https://ps.w.org/pods/assets/icon.svg?rev=3286397)
 * [Pods - Custom Content Types and Fields](https://wordpress.org/plugins/pods/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pods/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pods/)
 * [Active Topics](https://wordpress.org/support/plugin/pods/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pods/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pods/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [pdclark](https://wordpress.org/support/users/pdclark/)
 * Last activity: [1 year, 10 months ago](https://wordpress.org/support/topic/displaying-file-field/#post-17956134)
 * Status: resolved