Skip to content
Snippets Groups Projects
Commit 5096df9a authored by Roderik Muit's avatar Roderik Muit Committed by Wolfgang Ziegler
Browse files

Issue #3445134 by roderik: Remove custom_elements_everywhere submodule.

parent 2094ea7b
Branches
Tags
1 merge request!47Remove custom_elements_everywhere submodule.
Pipeline #165620 passed
......@@ -141,6 +141,20 @@ displays are applied, when an entity is being rendered:
## Upgrade from 2.x
### Preparation
Make sure some submodules are not enabled, or deal with uninstalling the
nonexistent modules later: (They have been removed as of the first 3.x release
because of their very small install base.)
* custom_elements_everywhere:
There is no 100% replacement; all entities/bundles can have Custom Elements
enabled in the corresponding "Manage display" tab in the UI. (In terms of
configuration: in each applicable
core.entity_view_display.TYPE.BUNDLE.VIEWMODE configuration entity, set
third_party_settings.custom_elements.enabled = true.)
TODO: By default custom-element display config is generated for all entity
bundles, thus rendering is changed to follow this config. If that's not desired,
regular displays can be still used by simply deleting this config entries for
......
# Custom elements everywhere
Enable custom elements on all entity view modes.
# Usage
Simply enable the module.
name: Custom Elements Everywhere
description: Render fields as custom elements on all view modes.
package: Other
type: module
core_version_requirement: ^8.8 || ^9 || ^10
dependencies:
- custom_elements:custom_elements
<?php
/**
* @file
* Custom elements hooks.
*/
/**
* Implements hook_entity_prepare_view().
*/
function custom_elements_everywhere_entity_prepare_view($entity_type_id, array $entities, array $displays, $view_mode) {
if (!\Drupal::service('router.admin_context')->isAdminRoute()) {
// Use this hook for enabling custom elements rendering since it applies
// to all proper entity rendering, but not to single-field rendered
// displays. Single field rendered displayed should be rendered as usual,
// such that custom elements processor may use it to render
// individual fields.
foreach ($displays as $display) {
$display->setThirdPartySetting('custom_elements', 'enabled', TRUE);
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment