Introducing the Published Page URL Module

A common question I get from new Sitecore Authors, is, “What will this page's URL be? The Sitecore Content Editor provides Item Path, and that can be enough at times, but leaves a lot to be desired. A multilingual implementation for instance will use Display Name and even at times a different domain. To help with this I created the Published Page URL Module, which will provide your content's calculated, final URL in the Content Editor interface.

What Comes Out of the Box

You can see here, you get the item's path, but that's not much. Yeah you can hit Preview but that also doesn't bring you to the Content Delivery instance, and the link isn't something you can share. 

Introducing the Module

The additional data section will appear immediately under Quick Info and be visible for all. The section automatically appears on items which have presentation details, so in other words, pages.

In the past we've built a way of doing this by adding a field to the Site node, but it requires introducing a base template and inheriting that. Also, the field needs to be authored, and it's just too many steps. This module allows all configuration through a config file, which can use Roles to set values based on environment. 

Configuration Variables

Let's go over a couple of the configuration options, which are stored in Feature.PublishedPageUrl.config.

  • RootUrl - Create a copy of this for each language in each site you have running. The message stored in NoUrlFoundWarning will be displayed instead of the URL if you're missing this setting.
  • EnableLinkInUrl - This will create a link in Content Editor that will always open in a new tab. If disabled, the URL will fall back to the standard behaviour of highlighting the string when you click on it so it can be copied. If you want to copy the URL when link is enabled, you can just use the browser's default right-click operation.

The rest are just text settings in case you want to use a different language in Content Editor. 

Getting the Module

You can find the module on GitHub, with a package file in the sc.package folder. Go ahead and grab it here.