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

Backend conversion of classic content to Gutenberg blocks #15894

Closed
iuravic opened this issue May 29, 2019 · 3 comments
Closed

Backend conversion of classic content to Gutenberg blocks #15894

iuravic opened this issue May 29, 2019 · 3 comments
Labels
[Type] Question Questions about the design or development of the editor.

Comments

@iuravic
Copy link

iuravic commented May 29, 2019

Hello!

I would kindly ask for advice on how to best implement the conversion of classic/pre-Gutenberg post content to blocks as a backend functionality. The need arises from multiple websites which need their old content converted to blocks (it is a significant number of sites, some with ~50,000 posts in history).

As far as I researched (from the Gutenberg Issues, PRs, and
WP Code Reference), this functionality is currently not yet available in the backend. So I would kindly appreciate any advices and suggestions on how to provide/implement this functionality via a backend endpoint/function.

The one current idea so far comes from this comment in Convert to blocks in PHP #13163 suggesting to "... use a node script running jsdom and use the wp.blocks.rawHandler function ...".

For now, I’ve only triggered the conversion of the content in the frontend programmatically, in a local installation of the Gutenberg in a VVV site -- very crudely, what I did was something in the lines of: select("core/editor") > getBlocks() > dispatch().replaceBlocks).

@swissspidy
Copy link
Member

As far as I can tell, the latest comment on #13163 is still accurate. What differentiates your ticket from that issue?

@talldan talldan added the [Type] Question Questions about the design or development of the editor. label May 30, 2019
@iuravic
Copy link
Author

iuravic commented May 30, 2019

The two Issues address the same point; just that since Issue #13163 was closed, with this new one I was simply hoping for an up-to-date confirmation that to use node was still the recommended path (to implement the conversion in the backend).

And so thank you for confirming this, Pascal! I'll proceed with the suggested method.

@danieliser
Copy link
Contributor

Why are these all closed, and after 5 years still no method to solve this, yet they still expect everybody to happily jump on the Gutenberg train like these major gaps in coverage don't exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Question Questions about the design or development of the editor.
Projects
None yet
Development

No branches or pull requests

4 participants