Problem/Motivation
Version 1 of the module supported paragraph behavior forms. That support seems to have been dropped at this time.
Steps to reproduce
Proposed resolution
Add support for behavior plugins.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | interdiff.txt | 7.8 KB | justin2pin |
| #10 | 3229555-10.patch | 12.09 KB | justin2pin |
Comments
Comment #2
pookmish commentedComment #3
pookmish commentedI took most of these parts from V1
Comment #4
anybodyHi @pookmish,
could you perhaps explain you use-case for this to allow a better decision why it should be implemented in 2.x again?
Comment #5
pookmish commentedWe use behaviors to allow the user to change the display of the content that is entered. Whether that be changing the view mode entirely or just perhaps wrapping the build with a class that can then be used to put colors on, change absolute positions, etc.
We have a multisite setup using Acquia's site factory (currently over 600 sites). We are using behavior plugins in a couple ways:
1. the normal php class way for more universal uses so that it's applicable to every site..
2. We've built out a yml plugin discovery that detects and builds behavior plugin derivatives from custom themes. This allows our individual sites to still have the customized look that they wish to provide to their users.
There's relatively small amount of code to implement to support that feature and I think it would be beneficial to more than just our large number of sites.
Comment #6
johnpitcairn commentedI would expect this to be available in 2.x.
We have a layout decision helper in 1.x using behavior plugins to semi-intelligently help editors select paragraph types, adjust margins, padding, backgrounds and per-breakpoint layout (via flexbox or css grid), without requiring them to understand how the various css classes involved need to work together, how many instances of a given class can be applied per-column or per-section, what are "forbidden" combinations, etc. It's a work in progress, but refactoring that would require a lot of theming work, and retraining editors who like what they have now.
An upgrade path should include the current functionality in 1.x, not arbitrarily chop bits out. Is there a good reason why this should not be implemented in 2.x?
Comment #7
justin2pin commentedFirst - totally agree, behaviors have to be supported in 2.x.
Second - @pookmish, I completely missed that you created a patch and created a similar one. Do you mind reviewing/testing this and letting me know what you think? Apologies for the duplicate effort, and thanks for reporting this.
Comment #8
pookmish commented@justin2pin, I think the differences between our two patches are minimal and mostly just about code style.
However there's a small change I'd make and this is entirely subjective. I've attached the patch and the interdiff. It's just putting the behaviors into a collapsible details.
Comment #9
johnpitcairn commented+1 for collapsible details element.
Comment #10
justin2pin commentedAn updated patch and interdiff are attached. Changes include:
- If we're going to move behaviors into collapsible details, let's make the position and label configurable. Personally I don't think "Behaviors" is descriptive enough for content editors in most situations, but I recognize that is very dependent on the specific context.
- While working with behaviors I noticed that the LayoutParagraphsBehavior plugin was not correctly implementing validate or submit functions for the behavior. I added those methods for both.
Comment #12
justin2pin commentedThis appears to be working correctly and is a big step forward for the module. @pookmish - thanks for reporting and working on this. I'm going to push #10 to dev and mark as fixed. Please re-open if you notice any issues.
Comment #13
anybodyGREAT work indeed, thank you all! :)
Could you perhaps have a final look at #3182691: User Editor role cannot select or change Paragraph Layout. which is think is related and perhaps easy to answer, if also fixed in 2.x now as you're in that topic?
Comment #15
roromedia commentedI am unable to apply Patch #10 on current beta9, therefore behaviors are not selectable in the modal. Could anyone pls. create an updated patch?