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

Text blocks #47528

Closed
ararTP opened this issue Jan 28, 2023 · 3 comments
Closed

Text blocks #47528

ararTP opened this issue Jan 28, 2023 · 3 comments
Labels
[Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed

Comments

@ararTP
Copy link

ararTP commented Jan 28, 2023

What problem does this address?

I want to create multiple blocks which retrieve data from a source (DB for example) into the block editor.
The problem I faced is that I want those blocks to have customization options.
To make this, I need to implement the customization options in each block which is waste off time and resources.

What is your proposed solution?

To create a new "text block" block type, which can be inserted into other blocks instead of text, and the block will simply return a plain text to the parent block, then the text will be customizable via the parent block (every block with text field inside, e.g paragraph, header, button etc.)

This arch can be even more useful if it will be possible to use them as attributes of blocks like src in an Image block

@talldan talldan added the [Status] Needs More Info Follow-up required in order to be actionable. label Jan 30, 2023
@talldan
Copy link
Contributor

talldan commented Jan 30, 2023

I'm not sure if I understand the proposal, would you be able to share more details? Maybe some pseudocode examples would help.

What you mention at the end sounds a bit like this suggested API - #39831.

I'm not sure what the status of that is.

@ararTP
Copy link
Author

ararTP commented Jan 30, 2023

@talldan I'm offering a solution to #37753 , instead of adding plain text to a block content , you will be able to add a "text block", which is a special block that doesn't have styles or structure, it will only return a plain string.
A "text block" will be registered with another function, like register_text_block_type or something else, and in the editor you will be able to add those text blocks as a content to other blocks like p, button etc or even to attributes.

@talldan
Copy link
Contributor

talldan commented Jan 30, 2023

The issue is that housekeeping gets very difficult when multiple issues are created for the same problem.

Maybe we could consolidate this under one issue? @ararTP would you be willing to leave a comment on #37753 with your proposal?

I'll close this down and add a link to this issue on the other issue.

@talldan talldan closed this as not planned Won't fix, can't repro, duplicate, stale Jan 30, 2023
@talldan talldan added [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed and removed [Status] Needs More Info Follow-up required in order to be actionable. labels Jan 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed
Projects
None yet
Development

No branches or pull requests

2 participants