Loading modules/custom_elements_ui/custom_elements_ui.module +4 −4 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ function custom_elements_ui_form_entity_view_display_edit_form_alter(&$form, For $display_entity = $display_form->getEntity(); $is_enabled = $display_entity->getThirdPartySetting('custom_elements', 'enabled', FALSE); // Hide the table of fields same as in field_ui. // Hide the table of fields custom_elements display is activated. if ($is_enabled) { $form['fields']['#access'] = FALSE; $form['#fields'] = []; Loading Loading @@ -81,6 +81,6 @@ function _custom_elements_ui_entity_view_display_edit_form_submit($form, FormSta /** @var \Drupal\Core\Entity\Entity\EntityViewDisplay $display_entity */ $display_entity = $display_form->getEntity(); $display_entity->setThirdPartySetting('custom_elements', 'enabled', $enabled); // @todo Autogenerate fields and name from view display entity? // @todo Autogenerate fields and names from view display entity? $display_entity->save(); } modules/custom_elements_ui/src/Form/EntityCustomElementsDisplayForm.php +2 −3 Original line number Diff line number Diff line Loading @@ -4,7 +4,6 @@ namespace Drupal\custom_elements_ui\Form; use Drupal\Core\Config\Entity\ConfigEntityBundleBase; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityWithPluginCollectionInterface; use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Field\PluginSettingsInterface; use Drupal\Core\Form\FormStateInterface; Loading modules/custom_elements_ui/src/Routing/RouteSubscriber.php +3 −4 Original line number Diff line number Diff line Loading @@ -50,17 +50,16 @@ class RouteSubscriber extends RouteSubscriberBase { } // Special parameter used to easily recognize all _field_ui routes. // routes. // Usage example: Drupal\Core\Entity\Enhancer\EntityBundleRouteEnhancer // Usage example: Drupal\Core\Entity\Enhancer\EntityBundleRouteEnhancer. $options['_field_ui'] = TRUE; $defaults = [ 'entity_type_id' => $entity_type_id, ]; // If the entity type has no bundles and it doesn't use {bundle} in its // admin path, use the entity type. // If the entity type has no bundles and it doesn't use {bundle} in its // admin path, use the entity type. if (strpos($path, '{bundle}') === FALSE) { if (!str_contains($path, '{bundle}')) { if (!$entity_type->hasKey('bundle')) { $defaults['bundle'] = $entity_type_id; } Loading src/Processor/DefaultContentEntityProcessor.php +2 −1 Original line number Diff line number Diff line Loading @@ -99,7 +99,7 @@ class DefaultContentEntityProcessor implements CustomElementProcessorInterface { if (!empty($ce_display_fields)) { $this->buildConfiguredCustomElement($entity, $element, $display); } // Otherwise render it from layout builder config if enabled/ // Otherwise render it from layout builder config if enabled. elseif ($display->getThirdPartySetting('layout_builder', 'enabled')) { // Skip processing of the fields and let the layout builder render it all. $this->addLayoutBuilderContent($entity, $element, $display); Loading Loading @@ -176,6 +176,7 @@ class DefaultContentEntityProcessor implements CustomElementProcessorInterface { case 'auto': $this->processAuto($field_items, $custom_element, $field_options['is_slot'], $field_options['label'], $display->getMode()); break; case 'raw': default: $this->processRaw($field_items, $custom_element, $field_options['is_slot'], $field_options['label']); Loading Loading
modules/custom_elements_ui/custom_elements_ui.module +4 −4 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ function custom_elements_ui_form_entity_view_display_edit_form_alter(&$form, For $display_entity = $display_form->getEntity(); $is_enabled = $display_entity->getThirdPartySetting('custom_elements', 'enabled', FALSE); // Hide the table of fields same as in field_ui. // Hide the table of fields custom_elements display is activated. if ($is_enabled) { $form['fields']['#access'] = FALSE; $form['#fields'] = []; Loading Loading @@ -81,6 +81,6 @@ function _custom_elements_ui_entity_view_display_edit_form_submit($form, FormSta /** @var \Drupal\Core\Entity\Entity\EntityViewDisplay $display_entity */ $display_entity = $display_form->getEntity(); $display_entity->setThirdPartySetting('custom_elements', 'enabled', $enabled); // @todo Autogenerate fields and name from view display entity? // @todo Autogenerate fields and names from view display entity? $display_entity->save(); }
modules/custom_elements_ui/src/Form/EntityCustomElementsDisplayForm.php +2 −3 Original line number Diff line number Diff line Loading @@ -4,7 +4,6 @@ namespace Drupal\custom_elements_ui\Form; use Drupal\Core\Config\Entity\ConfigEntityBundleBase; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityWithPluginCollectionInterface; use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Field\PluginSettingsInterface; use Drupal\Core\Form\FormStateInterface; Loading
modules/custom_elements_ui/src/Routing/RouteSubscriber.php +3 −4 Original line number Diff line number Diff line Loading @@ -50,17 +50,16 @@ class RouteSubscriber extends RouteSubscriberBase { } // Special parameter used to easily recognize all _field_ui routes. // routes. // Usage example: Drupal\Core\Entity\Enhancer\EntityBundleRouteEnhancer // Usage example: Drupal\Core\Entity\Enhancer\EntityBundleRouteEnhancer. $options['_field_ui'] = TRUE; $defaults = [ 'entity_type_id' => $entity_type_id, ]; // If the entity type has no bundles and it doesn't use {bundle} in its // admin path, use the entity type. // If the entity type has no bundles and it doesn't use {bundle} in its // admin path, use the entity type. if (strpos($path, '{bundle}') === FALSE) { if (!str_contains($path, '{bundle}')) { if (!$entity_type->hasKey('bundle')) { $defaults['bundle'] = $entity_type_id; } Loading
src/Processor/DefaultContentEntityProcessor.php +2 −1 Original line number Diff line number Diff line Loading @@ -99,7 +99,7 @@ class DefaultContentEntityProcessor implements CustomElementProcessorInterface { if (!empty($ce_display_fields)) { $this->buildConfiguredCustomElement($entity, $element, $display); } // Otherwise render it from layout builder config if enabled/ // Otherwise render it from layout builder config if enabled. elseif ($display->getThirdPartySetting('layout_builder', 'enabled')) { // Skip processing of the fields and let the layout builder render it all. $this->addLayoutBuilderContent($entity, $element, $display); Loading Loading @@ -176,6 +176,7 @@ class DefaultContentEntityProcessor implements CustomElementProcessorInterface { case 'auto': $this->processAuto($field_items, $custom_element, $field_options['is_slot'], $field_options['label'], $display->getMode()); break; case 'raw': default: $this->processRaw($field_items, $custom_element, $field_options['is_slot'], $field_options['label']); Loading