Repository navigation
feat: Headless readiness - #7850
Merged
Merged
Conversation
Member
|
@fsbraun Great work on this. I would love to see how this works in practise and what we can do with it? |
macolo
reviewed
Jun 25, 2024
macolo
reviewed
Jun 25, 2024
macolo
reviewed
Jun 25, 2024
macolo
reviewed
Jun 25, 2024
Member
Author
|
@macolo Thank youn for the comments! I've tried to improve the clarity of the |
marksweb
reviewed
Jun 25, 2024
Contributor
|
@fsbraun the docs now make a lot of sense to me, easy to understand! 💪 I like the design of this functionality, it seems quite intuitive to me from a developer's perspective. 👍 |
macolo
approved these changes
Jul 26, 2024
4 tasks done
4 tasks done
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.
Description
Regular projects distribute their content through serving pages at their corresponding URL as defined in the page tree. This is achieved by adding
path("", include(cms.urls))to a project'surls.py. Also, the CMS requiresCMS_TEMPLATESorCMS_TEMPLATE_DIRto be set.This PR allows setting up headless-ready projects by:
Not requiring
path("", include(cms.urls))being part of the projects URLs. All editing is done in the admin and the edit, structure and preview endpoints.The structure endpoint can be used on read-only objects (such as published pages), too, allowing to view the tree and copy plugins. All modifying actions are disabled for read-only objects.
Not requiring any templates to be defined. If no templates are available, all interaction runs through the structure endpoint. While the editing experience might be limited, this can be a fast way of setting up a project.
This PR moves the create wizard URL to the placeholder admin (which contains all editing endpoints) (but also keeps the previous endpoint in
cms.urlsfor the wizard for compatibility reasons).The data bridge allows the frontend to update the structure board after changes in the plugin tree. This PR changes the HTML response for changes in the plugin tree from inlining the data in a script to a script tag containing JSON objects which are read and passed to the data bridge.
Related resources
Checklist
develop-4