From 4ef43ebc63690472b96bbf2c3b1baf6b025e0d49 Mon Sep 17 00:00:00 2001 From: Heather Floyd Date: Wed, 15 Sep 2021 16:03:29 -0400 Subject: [PATCH 1/3] Update README.md Fix typo of Web.config app key --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2011711..0fd7e04 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Where docTypeName is the document type alias to be treated as a "virtual" node. You can define multiple "rules" by separating them with commas, e.g. ```xml - + ``` You can also use wildcards at the start and/or the end of the document type alias, like this: From b7d8fd44f124774f91cab7869c0638d169884a25 Mon Sep 17 00:00:00 2001 From: Heather Floyd Date: Wed, 15 Sep 2021 16:07:26 -0400 Subject: [PATCH 2/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0fd7e04..01014a7 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ You can define multiple "rules" by separating them with commas, e.g. You can also use wildcards at the start and/or the end of the document type alias, like this: ```xml - + ``` This means that all document type aliases ending with "dog", starting with "cat" or containing "mouse" will be treated as virtual nodes. From 275016b2068c776ec2b58331bbf0a2d41b5b2779 Mon Sep 17 00:00:00 2001 From: Heather Floyd Date: Thu, 16 Sep 2021 17:27:51 -0400 Subject: [PATCH 3/3] Fix for assigned hostnames using folder-style --- VirtualNodes/VirtualNodesUrlProvider.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/VirtualNodes/VirtualNodesUrlProvider.cs b/VirtualNodes/VirtualNodesUrlProvider.cs index 5be0253..63ea4a8 100644 --- a/VirtualNodes/VirtualNodesUrlProvider.cs +++ b/VirtualNodes/VirtualNodesUrlProvider.cs @@ -73,7 +73,7 @@ private UrlInfo ConstructUrl(UmbracoContext umbracoContext, IPublishedContent co var urlText = url == null ? "" : url.Text; // If we come from an absolute URL, strip the host part and keep it so that we can append - // it again when returing the URL. + // it again when returning the URL. var hostPart = ""; if (urlText.StartsWith("http")) @@ -96,7 +96,14 @@ private UrlInfo ConstructUrl(UmbracoContext umbracoContext, IPublishedContent co } // Now split the url. We should have as many elements as those in pathIds. + // - Unless the top-level node provided a folder-style hostname string[] urlParts = urlText.Split('/').Reverse().ToArray(); + var hasHostnameFolder = urlParts.Length > pathIds.Length; + if (hasHostnameFolder) + { + //recalc the pathIds + pathIds = path.Split(',').Skip(pathItemsToSkip-1).Reverse().ToArray(); + } // Iterate the url parts. Check the corresponding path id and if the document that corresponds there // is of a type that must be excluded from the path, just make that url part an empty string.