Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.2] Make export button optional #4484

Closed
carlcs opened this issue Jul 4, 2019 · 3 comments
Closed

[3.2] Make export button optional #4484

carlcs opened this issue Jul 4, 2019 · 3 comments
Labels
enhancement improvements to existing features user management 😇 features related to user management

Comments

@carlcs
Copy link
Contributor

carlcs commented Jul 4, 2019

It seems like the new element export feature currently doesn’t export data for relationship fields (including Matrix) which can make the feature a bit useless for some elements, at least from the client point of view.

I’m suggesting to make the feature optional, possibly via permissions. Configuration for every entry section, category type, etc. is probably a bit too much.

@brandonkelly
Copy link
Member

We do plan on adding a new JSON output format that would include relation info, and a built-in importer that can work with the exported JSON. Once that’s in place, I’m curious if you’d still care to disable exporting?

@brandonkelly brandonkelly added user management 😇 features related to user management enhancement improvements to existing features labels Jul 4, 2019
@carlcs
Copy link
Contributor Author

carlcs commented Jul 5, 2019

It would be especially helpful in the weeks until export becomes useful for all content.

But in general I feel like export and import is a feature you don’t really want to expose to all of your users.

@brandonkelly brandonkelly added this to the 3.4 milestone Dec 7, 2019
brandonkelly added a commit that referenced this issue Dec 10, 2019
@brandonkelly
Copy link
Member

It’s now possible to customize the available exporters for each element type (and source) in Craft 3.4, via a new EVENT_REGISTER_EXPORTERS event. You could register new exporters (#5090) or remove them.

use craft\elements\Entry;
use craft\events\RegisterElementExportersEvent;
use yii\base\Event;

Event::on(Entry::class, Entry::EVENT_REGISTER_EXPORTERS, function(RegisterElementExportersEvent $e) {
    $e->exporters = [];
});

We’ve also added a new “Expanded” export type that includes all relevant custom field values (including Matrix and relational fields), and can be optionally saved as a JSON file. So the built-in export functionality should be more useful to begin with :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement improvements to existing features user management 😇 features related to user management
Projects
None yet
Development

No branches or pull requests

2 participants