Hierarchical page management improvements

This commit is contained in:
Shaun Walker
2019-09-15 19:15:44 -04:00
parent 61dc27cf32
commit 7d353c2205
12 changed files with 354 additions and 199 deletions

View File

@ -140,8 +140,12 @@
pages = PageState.Pages;
}
// get Url path and querystring
// get Url path and querystring ( and remove anchors )
string path = new Uri(_absoluteUri).PathAndQuery.Substring(1);
if (path.IndexOf("#") != -1)
{
path = path.Substring(0, path.IndexOf("#"));
}
// parse querystring and remove
Dictionary<string, string> querystring = new Dictionary<string, string>();
@ -189,6 +193,13 @@
{
page = PageState.Page;
}
// failsafe in case router cannot locate the home page for the site
if (page == null && path == "")
{
page = pages.FirstOrDefault();
path = page.Path;
}
// check if page has changed
if (page.Path != path)
{