[DEFECT] Update Headless Examples to render Block Editor Contenlets Correctly
Problem Statement
After the recent backend fix that ensures GraphQL returns full contentlet data inside Block Editor blocks, we have to update the SDK headless examples (Next.js, Angular, and Astro) to the data correctly.
Previously, Block Editor nodes were accessed using:
props.attrs?.data
However, the updated backend response structure now nests the data under:
props.node.attrs?.data
This causes the headless example apps to fail to display contentlets embedded inside Block Editor fields — especially noticeable in blogs or pages using custom blocks.
As a result:
-
Headless apps (Next.js, Angular, Astro) do not render embedded contentlets (e.g., products, cards, custom blocks) inside Block Editor fields.
-
The Inline Editor inside the dotCMS Admin does show the contentlets, creating an inconsistency between inline editing and headless rendering.
-
We need to update all the example apps to read the new structure so they behave consistently with the CMS.
Steps to Reproduce
- Set up any of the headless example apps (Next.js, Angular, or Astro).
- Create or open a page or blog that contains a Block Editor field.
- Insert one or more contentlets (e.g., Product, Author, Card) inside the Block Editor.
- View the page in:
- Headless app (Next.js/Angular/Astro) → embedded contentlets do NOT render.
- CMS Inline Editor (Admin Panel) → embedded contentlets DO render correctly.
- Inspect the SDK component rendering the block:
- It still reads:
props.attrs?.data - But backend now provides:
props.node.attrs?.data
- It still reads:
Acceptance Criteria
- [ ] Update the Next.js example app to read Block Editor contentlet data using
props.node.attrs?.data. - [ ] Update the Angular example app to read Block Editor contentlet data using the new schema.
- [ ] Update the Astro example app to read Block Editor contentlet data using the new schema.
- [ ] Ensure all examples correctly render contentlets embedded inside Block Editor fields. Verify consistency between:
- Headless rendering (Next.js / Angular / Astro)
- CMS Inline Editor view
- [ ] Add/update documentation or comments explaining the new
node.attrs.datastructure.
dotCMS Version
Latest
Severity
Low - Minor issue or cosmetic
PRs linked to this issue
QA NOTES
Run the dotCMS examples (Angular, Next.js, Astro) and verify that contentlets inside the Block Editor render correctly in both the dotCMS Admin Panel and the example applications.
QA Passed
We changed the code to match the new API Response and the components are rendering correctly
https://github.com/user-attachments/assets/e09e120f-6d87-42a7-899c-adb70d7ceb1e