Conversation
1 task
Contributor
|
Claude finished @rjvelazco's task in 3m 7s —— View job Claude finished @rjvelazco's task in 1m 7s —— View job I'll analyze this and get back to you. |
window.dotUVE.createContentlet to create contentlets without adding them to the page
nicobytes
approved these changes
Apr 10, 2026
dario-daza
approved these changes
Apr 10, 2026
…tentlet-to-create-contentlets-v2
…n with user feedback
…create-contentlets-v2' of https://github.com/dotCMS/core into issue-33415-task-uve-provide-windowcreatecontentlet-to-create-contentlets-v2
…tentlet-to-create-contentlets-v2
Contributor
Rollback Safety AnalysisAll changes in this PR are pure frontend (TypeScript/JavaScript SDK and Angular components). No database migrations, no Elasticsearch mapping changes, no Java backend code, and no REST API contract changes. Checked against all rollback-unsafe categories (C-1 through C-4, H-1 through H-7, M-1 through M-4): none match. ✅ This PR is safe to rollback. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements #33415 — restoring the ability to create a contentlet from within the UVE without automatically dropping it onto the page layout.
In dotCMS v2, customers used
window.parent.addContentletfor this. That API broke in v24. This PR introduceswindow.dotUVE.createContentlet(contentTypeVariable)as the supported replacement.What changed
CREATE_CONTENTLET = 'create-contentlet'to theDotCMSUVEActionenum (@dotcms/types)createContentlet(contentType: string)to the UVE public API (@dotcms/uve)createContentleton thewindow.dotUVEglobal object (sdk-editor.ts)CREATE_CONTENTLETpostMessage action in the UVE editor — opens the creation dialog viacreateContentletFromPalettewithout anactionPayload, so the contentlet is saved to the system but not inserted into the pageHow to use
Traditional (VTL / JSP pages)
In any VTL template or widget running inside the UVE iframe, call:
This opens the creation dialog for the
calendarEventcontent type. When the user saves, the contentlet is created in dotCMS and the page reloads — the contentlet is not added to the current page layout.Example use case: A widget that renders all events for the current month. The editor wants to create a new event without dropping it on the page — the widget will pull it in automatically on the next render.
Headless (Next.js / React / Angular SDK)
Import
createContentletfrom@dotcms/uveand call it wherever needed:Example — React component:
The
createContentletcall sends apostMessageto the UVE parent frame, which opens the standard dotCMS content creation dialog. On save, the page refreshes to reflect the new content — but the contentlet is never inserted into the page containers.Video
video.mov
This PR fixes: #33415
This PR fixes: #33415