Renders the current state of the file tree to a specified HTML element.
import { defineFilePond } from 'filepond';
import { locale } from 'filepond/locales/en-gb.js';
import { EntryListView } from 'filepond/extensions/entry-list-view.js';
defineFilePond({
locale,
extensions: [
// Add the EntryListView extension
EntryListView
]
})
Adding a file poster
To add a poster to a file we set the poster property on the EntryListView property of a file entry.
import { defineFilePond } from "filepond";
import { locale } from "filepond/locales/en-gb.js";
import {
createFilePondEntryList,
appendEntryImageView,
} from "filepond/templates";
import { EntryListView } from "filepond/extensions/entry-list-view.js";
import { URLLoader } from "filepond/extensions/url-loader.js";
// Add image view to default template
const template = createFilePondEntryList();
appendEntryImageView(template);
// Get reference to the element
const [element] = defineFilePond({
locale,
extensions: [
// Need this to load entries from URLs
URLLoader,
// Set custom template
[
EntryListView,
{
template,
},
],
],
});
// Entries to load
element.entries = [
{
src: "my-file.txt",
extension: {
EntryListView: {
// This will be picked up by the ImageView component
poster: "./poster/my-poster.jpg",
},
},
},
];