One of the more common questions that comes up during Sitecore Author training is around the rename and display name functions inside of Sitecore. In this post, we’ll go through what each function does and also give some examples of how and when to use them effectively during the content authoring process.
What’s in a name?
The first time you create a new item in Sitecore you’re asked to name it. Sometimes this name will be applied to fields inside the item, for instance the H1 page title. More importantly, because this name will be used by Sitecore to define the Item Path, and may even be used to define the URL for the item, there are strict rules around what Sitecore will accept for item names. It will reject any names that include punctuation or special characters, or any name that starts or ends with a space. Sitecore does not mind any spaces within item names (like this) and can be adjusted to convert them to hyphens (like-this) as SEO best practices dictate. All that said, with fat-fingering and bad copy-paste typos also a possibility, it’s very easy to mess up the naming of an item. Now, which one should we use to fix it?
Rename
Sitecore’s Rename function affects how the item is seen by the outside world and is probably the function you’re looking for if:
- You made a typo and now your URL is /finance/personal/boroowing
- You need to adjust a URL for SEO purposes and want to make /a-really-good-url into /an-even-better-url
- You accidentally gave your item the same name as a nearby item and Sitecore created a confusing /a-good-url and /a-good-url for two different pages
- You accidentally gave your item the same name as a nearby item and Sitecore incremented one of your URLs to give you /a-good-url and /a-good-url01
To rename an item:
- Select the item in the Content Editor inside the content tree.
- Choose ‘Rename’ by either:
- Right-Click on the item in the Content Tree and select ‘Rename’.
- Select ‘Rename’ in the Rename section Home tab ribbon.
- Click on the name of the item in the Content Panel.
- Give your item a new name and click OK.
One final note on Rename:
As mentioned in my previous post on GUIDs, Sitecore doesn’t use your item’s name (or location) as a reference, so you should be OK to change it but be mindful and ask someone if you’re unsure. You should also keep in mind that rename will only affect the Item Name and Item Path, meaning you may still need to edit any fields that Sitecore automatically populated with the original item name that was entered (eg. the H1 Page Title).
Display Name
Sitecore’s Display Name function controls the language-specific name that you give an item, and in most instances will affect how the item is displayed within Sitecore.
For example, Sitecore will not let you create an item named Jim’s Page because of the apostrophe. You can create Jims Page to make /jims-page, and then use the Display Name function to correct the way this is displayed in Sitecore (as shown in the image below).
To change the Display Name on an item:
- Select the item in the Content Editor inside the content tree.
- Click “Display name” in the Rename section Home tab ribbon.
- Give your item a new Display Name name and click OK.
Some final notes on Display Name:
Depending on how your site was configured, Display Name may affect how your item is displayed in Site Navigation and other “dynamically driven” components. For example, the Display Name may be used to populate the link text when the page is selected for a dynamic Call-to-Action Component, or to provide a shorter Breadcrumb Title. Multi-Lingual sites have also been known to use the Display Name to create URLs for alternate language versions of pages (eg. English: /en/about-us, Spanish: /es/sobre-nosotros). As always, check with your development team before making Display Name changes to ensure you’re not going to get into trouble.
I hope this post on the differences between Sitecore’s rename and display name functions has cleared up some of the confusion surrounding these two features. Stay in the loop for more blog posts written specifically for content authors and marketing teams by clicking the “Sign Up” button to subscribe to our weekly blog digest. And check out my previous post on what a GUID is and how Sitecore uses them.