Problem/Motivation

After multiple discussions, we agreed that the recently introduced entity_ce_display deserves to have its own plugin type.

Proposed resolution

  • introduce new plugin type in addition to formatters with name(annotation) CustomElementFormatter;
  • make plugin type not configurable;
  • have attribute to decide whether it uses field formatters or not; usesFieldFormatters
  • in UI display only select with options;
  • default plugins in a module are:
    • auto
    • raw
    • formatted
  • show in new column next to "isSlot", dropdown of CE-formatters. Try to make field-formatters drop-down disabled based upon "usesFieldFormatters" value of the selected plugin
  • plugin adds data to custom-element object given the configruation (name)
  • it thus can use string|MarkupInterface for adding a slot, or a single CE or an array of CE objects
    • raw plugin with toArray() might need something like var_export() to map to String
    • if not a slot, passing an array is fine
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mostepaniukvm created an issue. See original summary.

mostepaniukvm’s picture

Assigned: Unassigned » mostepaniukvm

mostepaniukvm’s picture

mostepaniukvm’s picture

Assigned: mostepaniukvm » Unassigned
Status: Active » Needs work
fago’s picture

ok, this one needs some more work and possibly discussion. I've added my remarks to the WIP code.
@junkuncz Please take a look and then let's discuss!

junkuncz made their first commit to this issue’s fork.

roderik changed the visibility of the branch 3362625-customelementformatter-plugin-type to hidden.

roderik changed the visibility of the branch 3362625-customelementformatter-plugin-type to hidden.

junkuncz changed the visibility of the branch 3362625-customelementformatter-plugin-type to active.

junkuncz changed the visibility of the branch new-ce-formatter to hidden.

junkuncz changed the visibility of the branch 3.x to hidden.

junkuncz changed the visibility of the branch 8.x-2.x to hidden.

junkuncz changed the visibility of the branch 3359601-re-implement-with-new-concept to hidden.

fago’s picture

First step:
* Ship with auto and raw formatters

Follow-ups we need:
* Add support for field formatters
* Add UI for configuring CE-formatters
* Fix support for entity-prepare view step

roderik’s picture

Status: Needs work » Needs review

New MR for cleanup.

I have a question about enabled/disabled CE displays (in the comments).

roderik’s picture

Status: Needs review » Needs work

Setting back to Needs Work because of questions I have, that I'd probably like to address first -- and outside this issue queue is likely faster.

roderik’s picture

Status: Needs work » Needs review

..And then all the answers to the questions I had, seeped into my head overnight.

This is now changed, documented and for review again. I removed many of the earlier comments and questions I had earlier, from the MR. So only relevant comments are on there now.

  • fago committed 42eb74c4 on 3.x authored by roderik
    Issue #3362625 by roderik: Improve and fix tests for v3
    
fago’s picture

Status: Needs review » Needs work

@roderik

thanks, merged the tests-PR. This ticket got long and massive, let's add sub-tasks/issues for remaining/next steps?
I've left some non-blocking comments above, let's move any action items in sub-tasks/follow-up also, like one for the update path.

Setting to needs work for that, but when all follow-up/sub-tasks are added I think we can close this first one.

roderik’s picture

Status: Needs work » Fixed

Followup(s):

created #3443424: Finish documentation re. v3 update

modified #3426888: Indiciate when layout-builder handles rendering to be about the UI

There are some comments in the MR to be addressed, but that's clearly noted in the followup(s), so indeed, we can close this.

(Also updated the list in #3362617: [META] custom_elements_ui: 3.x alpha release

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.