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

Option for generating block editor-aware content #151

Open
cbirdsong opened this issue May 13, 2021 · 3 comments
Open

Option for generating block editor-aware content #151

cbirdsong opened this issue May 13, 2021 · 3 comments

Comments

@cbirdsong
Copy link

Fakerpress currently generates blocks of basic HTML, which show up in the block editor as "Classic Editor" blocks. It would be great if the content it generated was native to the block editor and used stock blocks and block options (align, color, drop cap, etc).

@cr0ybot
Copy link

cr0ybot commented Sep 8, 2024

I was hoping for this functionality too, but I also happen to know how difficult this would be to pull off. The PHP side of WordPress does not include any way to easily "render" blocks to the HTML format that is stored in the database. There are ways to get it to sort-of work using render_block(), but if you aren't feeding the results from parse_blocks() to it the output will often not work correctly. You can't just feed the function some expected block attributes and expect it to actually render the HTML. Currently the client-side JavaScript in the block editor is responsible for creating the commented HTML that is stored in the database. I'm not sure what the solution to this problem would be but it would future-proof this plugin tremendously.

@bordoni
Copy link
Owner

bordoni commented Nov 5, 2024

This is 100% in the roadmap. But I am waiting for Block Editor to be bit more stable on how certain blocks behave. So that we have a stable "API" for generating the randomness.

@cbirdsong
Copy link
Author

This plugin converts classic content to blocks server-side, though I haven't dug into how it works: https://github.com/10up/convert-to-blocks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants