Open navClose nav

Multi-File Upload Field

https://res.cloudinary.com/forestry-demo/image/fetch/c_limit,dpr_auto,f_auto,q_80,w_640/https://forestry.io/uploads/2018/01/multi-file-preview.png

Options

  • General
    • Label — the human-friendly label shown above the input field in the editor.
    • Name — the key stored in your content’s front matter, used to access it in your templates.
    • Description — a human friendly description of what the field does and/or instructions for your editors.
    • Hidden — hides the field in the editor, but allows developers to set default values or maintain the field for legacy purposes.

Templating

If you have a text field in your template, you can access it in your templates using the field’s name:

Hugo

<ul>
  {{ range .Params.gallery }}
    <li><img src="{{ . | relURL }}"></li>
  {{ end }}
</ul>

Use the relURL filter to automatically append your site’s baseURL

Jekyll

<ul>
  {% for image in page.gallery %}
    <li><img src="{{ image | relative_url }}"></li>
  {% endfor %}
</ul>

Use the relative_url filter to automatically append your site’s url and baseURL

Config Files

You can configure this field in Front Matter Template Config Files as follows:

type: image_gallery
name: [String]
label: [String]
description: [String]
default:
- [String]

Example

type: image_gallery
name: gallery
label: Gallery
description: Provide a gallery of photos
default:
- "/uploads/2017/08/20/placeholder.jpg"

Last updated on December 31, 2017