Closed (fixed)
Project:
Custom Elements
Version:
3.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
20 Aug 2024 at 18:46 UTC
Updated:
9 Sep 2024 at 16:49 UTC
Jump to comment: Most recent
Implement #3351239: Define and establish best-practice CE naming pattern
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
Comment #3
fagocreated the MR. This is a BC-breaking change, so we should add a change-record.
I think we even better output elements like "drupal-layout-one-col" or "drupal-layout-two-col". So appending the layout-id would make sense. But unfortunately the layout-ids are not really nice, so we probably would end up with IDs like "drupal-layout-layout-one-col".
Looking at the code, I think it would make sense to move it into a generator service + to invoke the CE-generator with the render array being $data. Then we have a place where we can improve this + allow contrib to override defaults.
We could also consider support a special layout definition key, like "custom_element_name" and if it's there we use it, so people defining their own layouts could prefix them nicely with module names while still have short element names. Not sure, that'S needed though.
Anyway, simply renaming this seems to be a good first step here.
Comment #4
useernamee commentedCode changes look good and I'd move this ticket into RTBC, however I'm not sure to which code this comment applies:
@fago Did you suggest to create a custom elements processor plugin for layout section entity?
Comment #5
useernamee commentedComment #6
fago> @fago Did you suggest to create a custom elements processor plugin for layout section entity?
yes, but that can be a follow-up!
Comment #7
useernamee commentedRTBC. I'm assigning to @roderik to decide when to merge and release.
Comment #8
roderikReminder to self, to make CR (also for #3449151: Improve custom-element default names for entiteis).
Release will be done hopefully very soon.
Comment #10
roderikCreated followup #3470343: Move layout builder code into processor service for the idea discussed.
Created CR https://www.drupal.org/node/3470342. It's very small and I don't think it needs extra info. So, for this time: closing this issue already. (If I see that CRs need more review, I'll change that practice.)
Comment #11
roderik