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

Add support for Reusable & Classic blocks #54

Closed
AndrewIontton93 opened this issue Apr 11, 2023 · 3 comments
Closed

Add support for Reusable & Classic blocks #54

AndrewIontton93 opened this issue Apr 11, 2023 · 3 comments
Labels
good first issue Issue that doesn't require previous experience with codebase type: feature New functionality being added

Comments

@AndrewIontton93
Copy link

Currently I cannot see a way to query reusable blocks or a classic block. I can see the typename available CoreBlock & CoreFreeform, however the blocks themselves don't actually appear in the page data.

For example, the below query does not return 'core/block' or 'core/freeform' on a page which has those blocks added.

editorBlocks {
      name
}
@theodesp
Copy link
Member

theodesp commented Apr 11, 2023

Hey @AndrewIontton93 thanks for the feedback.
Looking at the block.json for the CoreFreeform it looks like we need to handle an edge case here to retrieve the innerHTML for the block content.

Upon looking at the parsed CoreFreeform it looks like that Gutenberg does not save the blockName which is problematic:

{
  "data": {},
  "blockName": null,
  "attrs": [],
  "innerBlocks": [],
  "innerHTML": "\n\n<p>Example Freeform content</p>",
  "innerContent": [
    "\n\n<p>Example Freeform content</p>"
  ]
}

This is problematic since we are filtering the blocks that have no name even when they may have html content.

In that case I will open a ticket. to provide a custom handler for blocks that have no name to fallback to CoreFreeform as long as they are not empty.

As for the reusable blocks this would be a different ticket altogether.

I will let you know when we tackle the above issue with CoreFreeform since there is no alternative option for now.

@theodesp theodesp added type: feature New functionality being added good first issue Issue that doesn't require previous experience with codebase has_jira labels Apr 11, 2023
@theodesp
Copy link
Member

@AndrewIontton93 we will be providing support for Classic blocks in this sprint.

@theodesp
Copy link
Member

theodesp commented May 2, 2023

#59

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Issue that doesn't require previous experience with codebase type: feature New functionality being added
Projects
None yet
Development

No branches or pull requests

2 participants