New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow separate modal edit/delete/sort of Paragraph items #60
Comments
I've made some progress, I think. I would appreciate anyone with more code experience looking over the changes I'm attempting: https://github.com/backdrop-contrib/paragraphs/tree/contextual_edit Right now it seems to work for Nodes, and partially for Taxonomy Terms (ie. it allows edit and save but it duplicates the same Paragraph item every time you save it -- something's off on the delta somewhere). Comments or feedback welcome! |
Playing around with an alternate implementation that uses dropbutton instead of contextual link, so there are two separate branches related to this issue:
|
I've started to play around with the Dropbutton branch, looks really good at first sight. I like this approach more than the Contextual links approach. |
Editing a Paragraph using Dropbuttons, I've encountered a strange behavior: Upon Edit of a Paragraph, the background color and the Account menu in the header section of the page change their appearance. Looks like the styles are coming from the admin theme. Not sure if it's intended but that's not my issue. The issue is that this appearance remains after saving the Paragraph. (When I reload the page, it changes back to the expected appearance.) See the screenshots below. (1) View the page (2) Edit paragraph (3) Edited and saved |
@olafgrabienski I'm going to move that into a separate issue related to core bugs: #81 |
I've merged this in for the next alpha pre-release. Open new issues around this feature as you test! |
After two alphas and a beta, I think we're at a point where we can do a first formal release that includes this functionality (using dropbutton instead of contextual links). Big thanks to @olafgrabienski for helping me test and to those that did the heavy lifting (using contextual links) in the Drupal 7 thread with patches, testing and feedback, including: @ModulesUnraveled, @darthsteven, jonathanshaw, @iaminawe, Grayle, Nchase, @stevetweeddale, RAFA3L, delacosta456, @PascalMortier, 8bitplateau, Ludo.R, @StryKaizer, jeroen.b, @mirodietiker, @anotherjames, @Nebel54, @martijnhoutman, @vollepeer, @amoebanath, @rgpublic, vaccinemedia, screon, loominade, Alexandre360, reekris, and georgiana-albu. |
I have been meaning to see if I could figure out how to allow editing of individual Paragraph items via contextual link rather than requiring the entire node to be loaded. (For example, if one item way down the page needs a minor tweak, it would be way simpler to be able to edit that one item rather than load the entire page, scroll down to find that paragraph with everything else around it, potentially have to expand that Paragraph item before being able to edit it...)
My idea included opening the edit window in a modal and refreshing the page when it was submitted, but that may not be necessary. It turns out there's an issue (and a patch) in the Drupal queue that aims for very similar functionality (minus the modal). And follow up issues could be the ability to delete/insert Paragraphs in this way, and maybe even reorder (e.g. Move up, Move down).
I've tried to implement that first patch in the issue-60 branch.
The main issue I'm finding seems to be that host entity details aren't being tracked. This causes the access check to fail and the save to fail (Unable to save a paragraph without a valid reference to a host entity.).I've temporarily adjusted the access check to include a new permission rather than checking whether the user has access to update the host entity, and could override the save not to check the host entity as well (but then we'd lose Paragraph revisions on nodes when edited in this way).The text was updated successfully, but these errors were encountered: