Adds export buttons to collection list views so editors can download a collection's data as CSV or JSON. It is registered through the plugins array of the mzinga config, which is a Payload fork. Options cover disabled collections, a temporary export directory, button placement, a JSON replacer and CSV options.
Provide ability to export collections as CSV or JSON
Installation
npm i @newesissrl/payload-exportcollections-plugin40
Stars
3
Forks
6
Open Issues
7 months ago
Last Updated
0
Weekly Downloads
v1.0.3
npm Version
166.9 KB
Unpacked Size
4
Dependencies
Trends appear after 7 days of data. Daily snapshots have not started yet.
Trends appear after 7 days of data. Daily snapshots have not started yet.
Each point is npm's rolling 7-day download count.
Health Score
Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.
Badge for your README
[](https://payloaddirectory.dev/plugins/732042021-root)<a href="https://payloaddirectory.dev/plugins/732042021-root"><img src="https://payloaddirectory.dev/badge/732042021-root.svg" alt="Payload Directory"></a>README
Extends mzinga with the ability to export all collection's data to CSV or JSON
npm install @newesissrl/payload-exportcollections-plugin
import { exportCollectionsPlugin } from "@newesissrl/payload-exportcollections-plugin";
export default buildConfig({
....
plugins: [exportCollectionsPlugin(config?)],
i18n: {
resources: {
// to localize the buttons' labels
en: {
general: {
"export-list-csv": "Export list (CSV)",
"export-list-json": "Export list (JSON)",
},
},
it: {
general: {
"export-list-csv": "Esporta lista (CSV)",
"export-list-json": "Esporta lista (JSON)",
},
},
},
}
....
})
The plugin may expects a config object defined like this:
export type ExportCollectionsPluginConfig = {
disabledCollections?: string[];
rootDir?: string;
jsonReplacer?: (key: string, value: any) => any;
csvOptions?: Json2CsvOptions;
componentPlacement?:
| "AfterList"
| "AfterListTable"
| "BeforeList"
| "BeforeListTable";
};
where:
disabledCollections is a list of collections' slugs that you want to exclude from the plugin's enrichment.rootDir is the directory where to temporarily store the exported filescomponentPlacement identify where to place the componentjsonReplacer is a function useful to replace fields (and/or omit them in the final result). see herecsvOptions is the same implementation as per the core json-2-csv package. see hereIf you followed the above guide and still cannot see the buttons, it may be needed to update your webpack config as per below:
export default buildConfig({
admin: {
webpack: (config: any) => {
return {
...config,
resolve: {
...config.resolve,
alias: {
...config.resolve.alias,
payload: path.resolve("./node_modules/mzinga"), // this will fix the components usage of `useConfig` hook
}
}
}
}
}
})
Topics
payload plugin import export
Import and export collection data as JSON or CSV files from the Payload admin
350/wk23v3
payload extended import export plugin
Import CSV, JSON, Excel and TSV files into Payload collections with preview, field mapping and validation
280/wk29v3
import export
Import and export Payload collection data
9725.9k/wk45.4kv3
payload portable plugin
Export and import all Payload collections and globals as a single JSON file from the admin panel
400/wk0v3
payload wordpress
WordPress MySQL database adapter and migration tool for moving content into Payload with PostgreSQL
135v3
redirects
Manage internal and external redirects from a dedicated collection in the Payload admin panel
100105.3k/wk45.4kv3