Changes to Matrix Blocks and CKEditor Blocks should be part of a draft #14603
Replies: 8 comments 33 replies
-
Just to add in here so it's in one place:
|
Beta Was this translation helpful? Give feedback.
-
Some of these concerns have been expressed in this discussion, where I did not comment, because I thought it would be too much of an ask to negotiate changes of this nature so close to the Craft 5 launch. Nevertheless, I agree with all of the above and don't have much to add myself. I share the belief that the current behaviour can easily lead to unintended changes going live, and I don't expect authors to think of nested cards as related entries, especially in "content builder" scenarios. The only case where I would expect changes in nested entries to go live immediatelly would be in the "element index" mode, and even then, it could depend on the kind of relations, entries etc. Would it be possible to have an option, per matrix field, to either "save changes immediately" or "participate in owner drafts"? |
Beta Was this translation helpful? Give feedback.
-
@brandonkelly Can you comment on if/when those changes will be made to the behaviour for element cards in CKEditor and especially Matrix Blocks? We wanted to use the element cards display mode for our page builder Matrix field, but this issue makes this mode completely unusable for this use-case. Your comment #14286 (comment) sounds rather like this is the intended behaviour and there are no plans to change it? |
Beta Was this translation helpful? Give feedback.
-
I’ve been toying with this, but… it’s complicated. There are a couple aspects of how things work that I don’t want to veer away from:
That said, purely from a workflow perspective, I can see the benefit of being able to make edits across multiple nested entries, and having them all published at once. The original plan discussed in Discord was:
However:
So what do we do? As a starting point, it feels like showing provisional changes within element cards/chips—across the entire control panel—is an obvious improvement. So that part is already done (pending a11y review): #14975. For all slideouts capable of autosaving, we are also considering changing the “Close” button to “Done”. Coupled with the chips/cards showing provisional content, we think that will help communicate that it’s perfectly safe to close the slideout without losing your changes. That leaves the problem of not having an easy way to see and publish all your nested changes at once, which we’re still thinking about. |
Beta Was this translation helpful? Give feedback.
-
I think the problem is the assumed context. It feels like Brandon and team P&T are thinking as though the most nested element is always the contextual reference - whereas when I'm editing a page the page is the important context and everything else is subject to that. i.e., if the page is a draft everything in it is also a draft. I think in terms of the page because I am in the CMS's page editing context. The implementation of Cards really muddies that if the content of the card isn't isolated to the same context. Tough one. In my head, the behaviour Brandon describes is something I'd expect in a relational field like an Entry field. But not as part of an Entry Type. Which is not a field. It's its own thing. |
Beta Was this translation helpful? Give feedback.
-
Hey Brandon, this ticket had quite some comments on the philosophy of how things should work. I took some time to test Craft 5 with some smaller clients. So besides all technological topics, Craft CMS is a content management system. In the current state, I have to add a warning text to the CK Editor fields, that authors cannot make any changes to it when they do a draft because (button, image, quote, ...) changes will be live right away. Same is for Cards (although I can just not use it). Documentation at my clients now is as follows: Ideally they should use drafts for new versions of the content (event page for next year, new education offers, etc.), because they keep the revision history, slug (and more). But if there's changes to a CK Editor field (with blocks), they need to either duplicate the block, or save a new entry and switch them. It keeps getting harder to tell the benefits, because it is really confusing and feels wrong. My bigger clients want their interns to edit the content. And they understandably start to ask if we can get back to something easier. Will changes to CK be part of a draft at some point? Or is this something that will stay this way for a longer time? |
Beta Was this translation helpful? Give feedback.
-
Sanity solves this by differentiating between documents and objects. To quote someone else's explanation on the differences between the two:
Sanity's version of a matrix field is the array schema type. To create a page builder like experience, you would use an array of object types. You can also use an array of document types, but documents are like entries in that they exist on their own with revisions, etc. Not that I know how you would go about implementing something like this, but it seems like the need is for an object type entry. I created a discussion around this previously. |
Beta Was this translation helpful? Give feedback.
-
This is now resolved for Craft 5.5, via #16002 🎉 |
Beta Was this translation helpful? Give feedback.
-
If I edit a page with matrix blocks or blocks in CK Editor I would assume all changes to be local/temporary before I saved. No matter if I open an edit dialog or not. Unlike Entry Relations, which are relations.
What actually happens is: The change in the slideout menu is on the live site right away – not part of my draft.
craft.5.matrix.drafts.mov
From an authors point of view I would assume that all changes to this page are part of my draft. If I want to propose a revision of that page to my team, I want to be able to show it with changes to my blocks, too (without them being on the live site). It also adds a lot of risk, as in the past clients would let their work students do these kinds of jobs (without the need of technical schooling) – which could now accidentally edit the live page.
The current assumption (#14286) is, that the card view is an entry relation due to its definition. I would like to challenge this implementation. I agree that entries should always behave in the same and reliable way. An entry relation should open in the slideout and the change be applied to it. As a possible (theoretical) solution one could propose a differentiation between blocks (used in Matrix and CK Editor) and Entry Relations.
Thus I'd be very happy if changes to blocks are part of the provisional drafts and drafts.
Beta Was this translation helpful? Give feedback.
All reactions