diff --git a/core/profiles/standard/standard.links.menu.yml b/core/profiles/standard/standard.links.menu.yml deleted file mode 100644 index 2278b21..0000000 --- a/core/profiles/standard/standard.links.menu.yml +++ /dev/null @@ -1,4 +0,0 @@ -standard.front_page: - title: 'Home' - route_name: '' - menu_name: main diff --git a/core/profiles/standard/standard.profile b/core/profiles/standard/standard.profile index e3fb930..a751a07 100644 --- a/core/profiles/standard/standard.profile +++ b/core/profiles/standard/standard.profile @@ -7,6 +7,7 @@ use Drupal\contact\Entity\ContactForm; use Drupal\Core\Form\FormStateInterface; +use Drupal\menu_link_content\Entity\MenuLinkContent; /** * Implements hook_form_FORM_ID_alter() for install_configure_form(). @@ -18,9 +19,17 @@ function standard_form_install_configure_form_alter(&$form, FormStateInterface $ } /** - * Submission handler to sync the contact.form.feedback recipient. + * Submission handler. */ function standard_form_install_configure_submit($form, FormStateInterface $form_state) { + // Sync the contact.form.feedback recipient. $site_mail = $form_state->getValue('site_mail'); ContactForm::load('feedback')->setRecipients([$site_mail])->trustData()->save(); + // Populate the main menu. + $home = MenuLinkContent::create([ + 'title' => 'Home', + 'link' => ['uri' => 'internal:/'], + 'menu_name' => 'main', + ]); + $home->save(); }