X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Foutside_in%2Fsrc%2FBlock%2FBlockEntityOffCanvasForm.php;h=f97f79ae05e51fb89129a283b5758de7281cb8e7;hp=4e0f081fb5c840a14560cbcac263131b79f2e19d;hb=bfbba508964731508b9bd6d5835c2edc858db95b;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae diff --git a/web/core/modules/outside_in/src/Block/BlockEntityOffCanvasForm.php b/web/core/modules/outside_in/src/Block/BlockEntityOffCanvasForm.php index 4e0f081fb..f97f79ae0 100644 --- a/web/core/modules/outside_in/src/Block/BlockEntityOffCanvasForm.php +++ b/web/core/modules/outside_in/src/Block/BlockEntityOffCanvasForm.php @@ -44,7 +44,7 @@ class BlockEntityOffCanvasForm extends BlockForm { } $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, ]; @@ -52,6 +52,18 @@ class BlockEntityOffCanvasForm extends BlockForm { // 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; }