From c0f01e487e95619271cfd31c9f53122551a28f3b Mon Sep 17 00:00:00 2001
From: cairnsj <51908793+cairnsj@users.noreply.github.com>
Date: Thu, 28 Sep 2023 14:31:32 +0100
Subject: [PATCH 1/2] Update _SideMenu.cshtml
---
Childrens-Social-Care-CPD/Views/Shared/_SideMenu.cshtml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Childrens-Social-Care-CPD/Views/Shared/_SideMenu.cshtml b/Childrens-Social-Care-CPD/Views/Shared/_SideMenu.cshtml
index 4a4d251d..b942b204 100644
--- a/Childrens-Social-Care-CPD/Views/Shared/_SideMenu.cshtml
+++ b/Childrens-Social-Care-CPD/Views/Shared/_SideMenu.cshtml
@@ -6,7 +6,9 @@
@foreach (var menuItem in Model.Items)
{
- var css = ViewBag.ContextModel.PageName == menuItem.Uri
+ string pageName = $"/{ViewBag.ContextModel.PageName}";
+ string uri = menuItem.Uri.StartsWith("/") ? menuItem.Uri : $"/{menuItem.Uri}";
+ var css = pageName.StartsWith(uri)
? "dfe-vertical-nav__section-item dfe-vertical-nav__section-item--current"
: "dfe-vertical-nav__section-item";
From e718e3d74c744698997bd9d299fe16c6abe322d7 Mon Sep 17 00:00:00 2001
From: cairnsj <51908793+cairnsj@users.noreply.github.com>
Date: Thu, 28 Sep 2023 15:09:32 +0100
Subject: [PATCH 2/2] Update _SideMenu.cshtml
---
Childrens-Social-Care-CPD/Views/Shared/_SideMenu.cshtml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Childrens-Social-Care-CPD/Views/Shared/_SideMenu.cshtml b/Childrens-Social-Care-CPD/Views/Shared/_SideMenu.cshtml
index b942b204..afc1a032 100644
--- a/Childrens-Social-Care-CPD/Views/Shared/_SideMenu.cshtml
+++ b/Childrens-Social-Care-CPD/Views/Shared/_SideMenu.cshtml
@@ -7,7 +7,7 @@
@foreach (var menuItem in Model.Items)
{
string pageName = $"/{ViewBag.ContextModel.PageName}";
- string uri = menuItem.Uri.StartsWith("/") ? menuItem.Uri : $"/{menuItem.Uri}";
+ string uri = menuItem.Uri.StartsWith('/') ? menuItem.Uri : $"/{menuItem.Uri}";
var css = pageName.StartsWith(uri)
? "dfe-vertical-nav__section-item dfe-vertical-nav__section-item--current"
: "dfe-vertical-nav__section-item";