context_entity_field.module in Context entity field 8
File
context_entity_field.module
View source
<?php
use Drupal\Core\Routing\RouteMatchInterface;
function context_entity_field_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.context_entity_field':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The Context entity field module module lets users define conditions based on entity field values for when certain reactions should take place.') . '</p>';
$output .= '<p>' . t('For example: when viewing a certain node, some blocks should be placed as a reaction only when a node field has a specific value.') . '</p>';
return $output;
}
}
function context_entity_field_plugin_filter_condition_alter(array &$definitions, array $extra, $consumer) {
if (in_array($consumer, [
'block_ui',
'layout_builder',
])) {
foreach ($definitions as $key => &$definition) {
if ('entity_field' == $definition['id']) {
unset($definitions[$key]);
}
}
}
}