Blog

VirtualNodes - Ninja nodes that are excluded from Umbraco generated URLs

In this very blog, all posts are grouped under a node called "Posts". That's good, but "/blog/posts/a-blog-post" doesn't look as good as "/blog/a-blog-post". That's right, if only there was a way the "/posts/" part could be omitted.

 

We thought about that a lot - our first thought was to take advantage of the special umbracoUrlAlias field and setup our own URLs. But this would take time and would need both discipline and maintenance - discipline in having a uniform way of setting up URLs and maintenance because there would be an extra field to update should the title of the page changed.

Moreover, this wouldn't be the native Umbraco URL - we'd still have it, so we'd have two URLs pointing at the same page. In links pointing to any article, we would not be able to use the Url property for a node, and we'd have to check the umbracoUrlAlias property to decide which URL to point to.

To avoid all these, we created a plugin which lets you specify all document types that are considered "virtual" nodes. All document types that match have their parts excluded from the Umbraco-generated URL. "Posts" is one of them, that's why you are not seeing it in the Url above.

Get the source code at GitHub

Download the package from Our Umbraco



;