Loading src/Service/BlockClassHelperService.php +15 −0 Original line number Diff line number Diff line Loading @@ -133,6 +133,11 @@ class BlockClassHelperService { $entity->unsetThirdPartySetting('block_class', 'classes'); } // If there is no custom attributes, unset the Third Party Setting. if (empty($entity->getThirdPartySetting('block_class', 'custom_attributes'))) { $entity->unsetThirdPartySetting('block_class', 'custom_attributes'); } // Get the config object. $config = $this->configFactory->getEditable('block_class.settings'); Loading Loading @@ -297,6 +302,16 @@ class BlockClassHelperService { '#maxlength' => $maxlength_block_class_field, ]; if (!empty($config->get('enable_custom_attributes'))) { $form['third_party_settings']['block_class']['custom_attributes'] = [ '#type' => 'textfield', '#title' => $this->t('Custom Attributes'), '#description' => $this->t('Here you can insert any attributes, for example: data-attribute-invite=new-data'), '#default_value' => $block->getThirdPartySetting('block_class', 'custom_attributes'), '#maxlength' => 255, ]; } if (empty($block->getThirdPartySetting('block_class', 'classes'))) { $form['third_party_settings']['block_class']['classes']['#autocomplete_route_name'] = 'block_class.autocomplete'; } Loading Loading
src/Service/BlockClassHelperService.php +15 −0 Original line number Diff line number Diff line Loading @@ -133,6 +133,11 @@ class BlockClassHelperService { $entity->unsetThirdPartySetting('block_class', 'classes'); } // If there is no custom attributes, unset the Third Party Setting. if (empty($entity->getThirdPartySetting('block_class', 'custom_attributes'))) { $entity->unsetThirdPartySetting('block_class', 'custom_attributes'); } // Get the config object. $config = $this->configFactory->getEditable('block_class.settings'); Loading Loading @@ -297,6 +302,16 @@ class BlockClassHelperService { '#maxlength' => $maxlength_block_class_field, ]; if (!empty($config->get('enable_custom_attributes'))) { $form['third_party_settings']['block_class']['custom_attributes'] = [ '#type' => 'textfield', '#title' => $this->t('Custom Attributes'), '#description' => $this->t('Here you can insert any attributes, for example: data-attribute-invite=new-data'), '#default_value' => $block->getThirdPartySetting('block_class', 'custom_attributes'), '#maxlength' => 255, ]; } if (empty($block->getThirdPartySetting('block_class', 'classes'))) { $form['third_party_settings']['block_class']['classes']['#autocomplete_route_name'] = 'block_class.autocomplete'; } Loading