For the complete documentation index, see llms.txt. This page is also available as Markdown.

Displaying File (attachment) field

Advanced Views natively supports the following file types:

  1. WordPress: attachment

  2. ACF: any File field

  3. MetaBox: any File, FileAdvanced, FileInput, FileUpload field

  4. Pods: any File field

1. How to display a File field

  1. Add any File field

  2. Save the Layout, copy its embedding shortcode

  3. Embed Layout: paste the shortcode inside the target place

Advanced Views automatically creates HTML markup and loads file metadata (like name and url) into the template.

You can customize the Layout template to use the File render options.

The Link Label is useful when you want to have more consistency in the output, fill out the Link Label to replace the link text of your file. By default the File name from the file attachment is used.

2. Displaying file details

By default, the File field is displayed as a link, which suits most use cases. However, in some instances, you might want to display detailed information about the file.

For example, if you've created a file field where a video has been selected, you may want to display it as a video player. All WordPress media items, including images and files (videos, PDFs), belong to the 'attachment' post type. This means you can use any standard post fields.

Here’s how to do it:

  1. Create a ‘File Details’ Layout: This Layout will be responsible for displaying file details. In the Fields tab, assign the file fields you want to display, then publish the Layout.

  2. Create a page Layout: Create a page Layout. In the Fields tab, add the target File field, and assign 'File Details' as a Field Layout, then publish the page Layout

  3. Embed page Layout: copy and paste the page Layout shortcode inside the target place

That's it! Now you can customize the Layout template to use the File render options.

Last updated