}
$form['advanced_link'] = [
'#type' => 'link',
- '#title' => $this->t('Advanced options'),
+ '#title' => $this->t('Advanced block options'),
'#url' => $this->entity->toUrl('edit-form', ['query' => $query]),
'#weight' => 1000,
];
// Remove the ID and region elements.
unset($form['id'], $form['region'], $form['settings']['admin_label']);
+ if (isset($form['settings']['label_display']) && isset($form['settings']['label'])) {
+ // Only show the label input if the label will be shown on the page.
+ $form['settings']['label_display']['#weight'] = -100;
+ $form['settings']['label']['#states']['visible'] = [
+ ':input[name="settings[label_display]"]' => ['checked' => TRUE],
+ ];
+
+ // Relabel to "Block title" because on the front-end this may be confused
+ // with page title.
+ $form['settings']['label']['#title'] = $this->t("Block title");
+ $form['settings']['label_display']['#title'] = $this->t("Display block title");
+ }
return $form;
}