Commit 88b1a37e authored by Eric Bremner's avatar Eric Bremner
Browse files

ISTWCMS-5307: adding menu link for projects to install and update hooks

parent 7a94a97c
......@@ -68,6 +68,13 @@ function uw_sites_all_install() {
function _uw_sites_all_get_menu_items(): array {
return [
'Projects' => [
'title' => 'Projects',
'menu_name' => 'main',
'route_name' => 'uw_ct_project.listing',
'weight' => 30,
'enabled' => FALSE,
],
'Opportunities' => [
'title' => 'Opportunities',
'menu_name' => 'main',
......@@ -601,4 +608,17 @@ function uw_sites_all_update_9107(&$sandbox) {
$roles['uw_role_site_manager']->save();
$roles['uw_role_content_editor']->save();
$roles['uw_role_content_author']->save();
// Create the URL from the route name.
$url = URL::fromRoute('uw_ct_project.listing')
->toString();
// Create the actual menu link.
MenuLinkContent::create([
'title' => 'Projects',
'link' => ['uri' => 'internal:' . $url],
'menu_name' => 'main',
'weight' => 30,
'enabled' => FALSE,
])->save();
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment