-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Support Placement for Field Editor Options #4484
Conversation
…s to support TextField_Edit__Options shape type
I'm lost too ;) I worked on it but a while ago. Yes, as i remember this delimiter is used to add specificity but not to change the underlying shape type and the related descriptor that will be used, then we can morph the shape type when creating a concrete shape and its final name will be used for rendering if no other alternates are provided. We use this delimiter e.g for content type but to provide additional alternates, not to morph the shape type. Here we do a shape type morphing in
Maybe we could have used There is this same kind of code in
And in
So, in LGTM |
@deanmarcussen what shape are you using in placement.json ?
|
@ns8482e What I discover when trying this is that when shapes are read into the shape table, and the So if you look in the shape table for This PR uses the same logic to remove any To actually do placement alternations to these shapes you can use placement like this (but only with this PR)
In this case I use the differentiator as it is easier than the |
@deanmarcussen differentiator won't work for me as It's same HtmlField. Editor type should be part of differentiator Line 35 in 763aa59
if above line changed to include editor type, I could write as following
|
I'm not against adding the editor type to the differentiator, but can you explain more. I'm trying to understand how the same fieldname from the same widget can be rendered with two different editors? |
@deanmarcussen The reason why we should add editor type to the differentiator is that each Field editor provides different user experience and any module can introduce new field editor for a given content field. Adding the editor type to the differentiator would allows user to experience different look and feel. Without editor type to the differentiatorNotice that changing editor type has no effect in placement placement.json used with this PR
With editor type to the differentiatorNotice that changing editor type also has effect in placement placement.json used with this PR and with editor type added to the differentiator
Only drawback is - for Notes to be displayed always on "Notes" tab, I have to explicitly define placement for each editor type. Here I have defined only "Multiline" editor to be placed on "Notes" tab hence, changing it to "Wysiwyg" moved it to content tab |
@ns8482e ok I see where you're coming from, but the drawback you mention about the having to specify the editor is the problem for me. For me, without is enough.
However if you need the feature, I suggest you consider opening another pr if this one goes through. Just an idea, but one other option that might work is a pattern matching option on the differentiator. The problem would be performance then because they're currently dictionary based lookups I think. |
@deanmarcussen As you prefer - I'll create another PR. However, It's obvious to include editor type in differentiator. I am not suggesting anything new, The display counterpart is already doing it. Line 49 in 763aa59
Here editor type is nothing but a shape type. |
For me too. Why would you define placement rules that depend on the editor, like you are switching back and forth? You chose an editor independently of the location. Then if you want to change the location, you also change it. |
To me, Administrator != Developer, and new Editor can be created in a module where developer can define placement, that, the developer may prefer to place editor based on module placement Also not to forget, placement.json is embedded in assembly. |
Fixes #4483
When trying to find placement for a field editor options like
TextField_Edit__Color
the key in the shape descriptor lookup is expectingTextField_Edit
, so this strips theshapeType
in the same way that theShapeAlterationBuilder
does when creating the placement alteration.Maybe fixing something in the wrong place again here though, as placement is a maze :)
@jtketch any thoughts?