diff --git a/app/views/shared/header.asp b/app/views/shared/header.asp index 22226d6..ddf539b 100644 --- a/app/views/shared/header.asp +++ b/app/views/shared/header.asp @@ -13,20 +13,24 @@ If IsObject(CurrentController) Then End If On Error GoTo 0 End If - If Len(pageTitle) = 0 Then pageTitle = "BrainOrdure" -Dim currentPath -currentPath = LCase(Request.ServerVariables("HTTP_X_ORIGINAL_URL")) -If InStr(currentPath, "?") > 0 Then currentPath = Left(currentPath, InStr(currentPath, "?") - 1) +Dim hdr_path +hdr_path = LCase(Request.ServerVariables("HTTP_X_ORIGINAL_URL")) +If InStr(hdr_path, "?") > 0 Then hdr_path = Left(hdr_path, InStr(hdr_path, "?") - 1) -Function NavClass(ByVal prefix) - If Left(currentPath, Len(prefix)) = prefix Then - NavClass = "nav-link active" - Else - NavClass = "nav-link" - End If -End Function +Dim hdr_navHome, hdr_navPosts, hdr_navCats +hdr_navHome = "nav-link" +hdr_navPosts = "nav-link" +hdr_navCats = "nav-link" + +If hdr_path = "/" Or hdr_path = "" Or Left(hdr_path, 5) = "/home" Then + hdr_navHome = "nav-link active" +ElseIf Left(hdr_path, 6) = "/posts" Then + hdr_navPosts = "nav-link active" +ElseIf Left(hdr_path, 11) = "/categories" Then + hdr_navCats = "nav-link active" +End If %>
@@ -52,13 +56,13 @@ End Function