Export entries, collections and users from Statamic to a variety of formats including XLSX, CSV, HTML and more.
- ✅ Statamic v4
- ✅ Statamic v5
Get your entries and collections ready in the format you need. Currently, we support the following formats:
- XLSX: Ideal for detailed data analysis and reporting in Excel.
- CSV: Perfect for data import/export with other systems.
- TSV: A tab-separated format, offering an alternative to CSV.
- ODS: For users of OpenDocument spreadsheet applications.
- XLS: Compatible with older versions of Excel.
- HTML: Web-friendly format, easily convertible to PDF with online tools.
Why no PDF you ask? Well, we're working on it. But for now, you can use the HTML format and convert it to PDF using a variety of tools available online.
We tried to use the best human-readable representation for each fieldtype. For example, the Entries
fieldtype will be
represented as a comma separated list of entry titles instead of multiple entry IDs.
Exporting users works the same way as exporting entries. You can either export specific users via the user listing or export all users using the utility.
So, there are quite a few fieldtypes available in Statamic. We're supporting all of them, even custom ones. The
fieldtypes \Statamic\Fieldtypes\Hidden
, \Statamic\Fieldtypes\Revealer
, \Statamic\Fieldtypes\Html
and
\Statamic\Fieldtypes\Spacer
are excluded by default because they don't contain any data.
If your custom fieldtypes extend one of the default fieldtypes, it should work just fine as is. But if you have a fully
custom fieldtype, you can add support for it by defining it in the config/export.php
file and providing a closure that
returns a string representation of the field value.
<?php
return [
/*
|--------------------------------------------------------------------------
| Fieldtype Mappings
|--------------------------------------------------------------------------
|
| Define custom mappings for how specific fieldtypes should be converted to
| strings during export. Each key should be the fully qualified class name
| of the fieldtype, and the value should be a closure that receives the
| field value and returns a string.
|
*/
'fieldtype_mappings' => [
\Custom\Fieldtype::class => function (\Statamic\Fields\Value $value) {
// ... do something with the value ...
return (string) $transformedValue;
},
],
];
You can search for this addon in the Tools > Addons
section of the Statamic control panel and click install.
Alternatively, install the addon using Composer by running the following command in your project root:
composer require doefom/statamic-export
Once installed, there are basically two ways to use this addon.
- Head to the entries listing of one of your collections.
- Select one or more entries.
- Click the "Export" action above the table.
- Choose your export format, exclude certain fields if you want to and specify whether you'd like to include headers ( included by default).
- Navigate to Users.
- Select one or more users.
- Click the "Export" action above the table.
- Choose your export format, exclude certain fields if you want to and specify whether you'd like to include headers ( included by default).
- Navigate to Utilities > Export.
- Select the "Collections" tab.
- Select your collection, export format, add excluded fields if you want to and specify whether to include headers or not.
- Click the "Export collection" button.
- Navigate to Utilities > Export.
- Select the "Users" tab.
- Select the export format, add excluded fields if you want to and specify whether to include headers or not.
- Click the "Export users" button.
- Introduce support for custom fieldtypes that do not extend the default fieldtypes
- Support exporting users
- Implement PDF export functionality
- Support setting the export filename