Repository navigation
Element fragments - #2520
Merged
Merged
Element fragments#2520
Conversation
Selected content elements are copied into a single section of a chapter of the shared fragment library that is marked with kind contentElements. Backdrop content elements become regular content elements since nothing would display them as backdrop of the fragment section. Move rewriting of file references out of SectionsCopy so that ContentElementsCopy can reuse it.
Fragments read their kind from the fragment chapter. Chapters without kind predate content elements fragments and contain sections. The fragment library dialog only offers section fragments.
Offer an action in the multi selection menu and in the actions menu of a single content element that asks for a name and copies the content elements into the fragment library. The name dialog now receives the prefilled title instead of reading it from a chapter.
Respond with type names and configurations of the content elements of a fragment, with file references rewritten to files that are now used in the entry. The editor inserts them like new content elements, so text blocks can be split and merged with adjacent text blocks whose file links already point to files of the entry. Rewriting only once both sides refer to files of the same entry is what makes that merge safe.
Prepare rendering fragment thumbnails in the insert content element dialog.
With the fragments feature, the insert element dialog gets a tab bar with content element types and shared fragments. The tab bar's border is the only full width rule, so category names turn into small labels without dividers. Libraries are loaded the first time the fragments tab is shown.
Clicking a fragment prepares its content elements on the server and inserts them via a batch like new content elements. That way a fragment can split a text block and its outer text blocks merge with adjacent text blocks. Fragments can not be inserted as backdrop.
Thumbnails in the insert element dialog take layout, appearance and invert of the target section.
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.
No description provided.