- Issue created by @brunodbo
In \Drupal\google_analytics_counter\GoogleAnalyticsCounterCustomFieldGenerator::gacAddField
, the GAC field is being added to the default and teaser view modes:
// Assign display settings for the 'default' and 'teaser' view modes.
$this->entityDisplayRepository
->getViewDisplay('node', $type->id(), 'default')
->setComponent('google_analytics_counter', [
'label' => 'hidden',
'type' => 'number',
])
->save();
// The teaser view mode is created by the Standard profile and therefore
// might not exist.
$view_modes = $this->entityDisplayRepository->getViewModes('node');
if (isset($view_modes['teaser'])) {
$this->entityDisplayRepository
->getViewDisplay('node', $type->id(), 'teaser')
->setComponent('google_analytics_counter', [
'label' => 'hidden',
'type' => 'textfield',
])
->save();
I'm wondering whether the field_google_analytics_counter
is the correct one to add - isn't the field called field_google_analytics_counter? Or is field_google_analytics_counter
referring to something else? When I look at my default and teaser display modes of a content type that I've enabled on /admin/config/system/google-analytics-counter-configure-types
, I'm not seeing the google_analytics_counter
listed on the view display page.
Active
4.0
Code