Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

RfC - Headless django CMS via REST API - resolved ✅#7835

macolo started this conversation inGeneral
Discussion options

macolo
Mar 7, 2024
MaintainerSponsor

Intro

Technical considerations

  • much of django CMS editing interface is using django admin forms inside iframes. This is an approach that we can continue to make use of for headless implementations as well.
  • The big advantage of relying on django admin forms is that we can stand on the shoulders of "django admin" and the editor experience is seamless across django admin and django cms admin interfaces.
  • We plan to achieve basic headless mode (v1) in the following way:
    • page tree and django admin via /admin url can be loaded in a separate browser tab - DONE
    • the page content editing sidebar and cms menu bar can be loaded in a separate browser tab - DONE
    • RfC - make registration of placeholders possible independently from Templates - resolved ✅ #7927 - DONE
    • a version of the website frontend can be loaded in a separate browser tab via versioning - DONE
    • the published version of the content models including page tree should be accessible read-only via REST API - DONE
  • milestones:
You must be logged in to vote

Replies: 4 comments 2 replies

Comment options

jrief
Mar 7, 2024
Collaborator

In case you are interested, I created aRichtextArea widget based on TipTap, where you can attach any arbitrary Django form. This all works with the new<dialog>-HTML element and does not require any Django-admin, nor does is need an<iframe>.

Why is that important?

Consider elements, such as<a href="…">,<img src="…">,<button …>, etc. where the user must enter more than one extra field.
For example a link: This could just be the URL of an external website, but often we need many more input fields, for instance if we want to link onto objects inside our database, so that they are independent of the URL mapping. Or if we want to specify thetarget orrel attributes.

When using images in richtext, it even becomes more complicate than that. We then need a way to store the image's payload data somewhere on disk, whereas we want the metadata (width, height, alignment, etc.) inside the document. There is no one-fits-all solution for that, we want the customer to design their model describing the values they need.

In django-formset version 1.4 this will be possible. One then can create his own form definition in Python and attach it to a TipTap control element. Clicking on that button will open a dialog window with the fields declared in the mentioned form. This can be used for any kind of extra control elements inside your richtext editor. The data submitted by those dialog forms, then is merged
with the "rich" text and its payload can be stored in JSON in any database.

The latter has the advantage that no such thing as "text enabled plugins" are required anymore.

You must be logged in to vote
2 replies
@macolo
Comment options

macoloMar 12, 2024
Maintainer AuthorSponsor

Just for visibility, I'll add to this that we are working on djangocms-text which will provide a satisfactory UX for text-enabled plugins. :)

@jrief
Comment options

jriefMar 12, 2024
Collaborator

Adopting django-formset would make sense, if django-CMS wants to avoid relying on the Django-Admin for editing plugins. Then plugins could be edited by just declaring a Django form. This also would prevent the need for an<iframe> serving Django's admin content. Of course, this would require a lot more effort to integrate.

Comment options

fsbraun
Mar 21, 2024
MaintainerSponsor

We will also have to json-ify the data bridge:#7850

You must be logged in to vote
0 replies
Comment options

From my point of view, the most important part would be the possibility to add and edit plugins into placeholder via the Django Admin. This by it self enables everyone to use the Django CMS headless by implementing the API part on it's own. This could be a good first step into a fully headlines CMS.

You must be logged in to vote
0 replies
Comment options

macolo
Jun 26, 2024
Maintainer AuthorSponsor

Quick update - in the meantime a lot of effort and progress has been made, please see djangocms-rest (https://github.com/fsbraun/djangocms-rest) and#7850 (Headless Readiness of the core) for further information.

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
General
4 participants
@macolo@jrief@fsbraun@ralfbraendli

[8]ページ先頭

©2009-2025 Movatter.jp