lightning_page.module in Lightning Core 8
File
modules/lightning_page/lightning_page.module
View source
<?php
use Drupal\field\FieldConfigInterface;
function lightning_page_field_config_insert(FieldConfigInterface $field) {
if (\Drupal::isConfigSyncing()) {
return;
}
elseif ($field
->id() == 'node.page.field_meta_tags') {
entity_get_display('node', 'page', 'default')
->setComponent('field_meta_tags', [
'type' => 'metatag_empty_formatter',
'region' => 'content',
])
->save();
entity_get_form_display('node', 'page', 'default')
->setComponent('field_meta_tags', [
'type' => 'metatag_firehose',
'region' => 'content',
])
->save();
}
}