Closed (fixed)
Project:
Custom Elements
Version:
3.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
9 Oct 2025 at 10:54 UTC
Updated:
12 Dec 2025 at 08:09 UTC
Jump to comment: Most recent

Comments
Comment #2
useernamee commentedComment #3
useernamee commentedI'm a bit stuck with refreshing because the preview custom element (in ce display entity form) is build with
The ce_display has values from the last form save and not from the last edit, until I call the
copyFormValuesToEntity. This updates ce_display but it doesn't have effect because Custom Element is generated only with the $ce_display->getMode() which is the last save ce display again.What we're missing is a method to generate Custom Element out of $ce_display directly.
Comment #5
useernamee commentedI overcome the issue by slightly adjusting the API from CustomElementsGenerator. NR
Comment #6
useernamee commentedComment #7
fagoThanks! I commented https://git.drupalcode.org/project/custom_elements/-/merge_requests/139 - please take a look.
> What we're missing is a method to generate Custom Element out of $ce_display directly.
yeah, let's introduce it then, as a separte method + make the existing method call the new helper?
Comment #10
useernamee commentedComment #11
fagothx, that looks mostly great now! I've found case where I think we should throw an exception though, see MR. Could you check that?
Comment #12
useernamee commentedfixed
Comment #13
fagoMR looks good. However, when testing changes I do not see the button?
The preview is refreshed when changing formatter settings, but when e.g. renaming a field in output, I don't have a way to update the preview still? So something seems not right here.
Comment #14
fagoOne more though. Maybe we should do it similar to Views, and simply have a preview-area that is always there + a button to make it load? Since we need the button to make it load anyway, the fieldset wrapper seems unnecessary. Then we could add a drop-down to select the desired preview-provider also. --> for the dropdown we need not use the plugins but get the list of provider-services from our provider-resolver.
Comment #15
useernamee commented@fago maybe it would be better to create a follow up for dropdown to select preview provider.
Comment #17
fago