juni 02, 2015
Does Sitecore have you wondering: what's a page editor? A content tree? You're in the right place. This post gives you an introduction to terminology and URL creation:
So you've been handed over a website on Sitecore or have undergone a completely new build on the customer experience platform and are now required to maintain and update your new web presence. It can be a pretty overwhelming endeavour, but not to worry! We've pulled together some helpful tips on getting started. Looking for something a bit more advanced? Check out how to troubleshoot form duplication in Web Forms for Marketers, our look at content versions in Sitecore or 3 top tips for content authors.
Sitecore organizes its content and configurations in a hierarchical tree structure, referred to as its Content Tree.
Each entry in the tree is an Item.
Items are based on Templates. A page in your site is simply an item with a specifically defined template.
Templates contain Fields. Fields are used to store content.
Fields have Field Types. These define the type of content that a field can store (e.g. Image, rich text, unformatted text, etc.).
Fields also have Validators, which validate the content entered in a field. When a field is invalid, a validator warns the content author. Sitecore includes validators including “required,” "Is Email," "Is Integer," etc. can be created.
Fields can have default values when an item is created. For example, a checkbox can be checked or unchecked by default.
Default values for text fields support tokens. Tokens get replaced with real-time content when an item is created. For example, $name gets replaced with the name given to the item when the item is created. $date gets replaced with the current date.
How to define the URL to a page
URLs in Sitecore are created from the names given to the pages in the content tree by the content author.
When a content author creates a page, they are prompted to give the page a name. This name is directly used in the URL. It also means that since URLs have character restrictions, a Sitecore page name will only support characters that create a valid URL. For example, the text "Landing Page" is perfectly valid:
However, if invalid characters are used (such as special characters) Sitecore will not permit the creation of the item, instead prompting the content author with a validation message:
Now that we understand why Sitecore limits the characters used in item names, let's walk through an example to illustrate how URLs are created using our imaginary test URL: http://training.valtech.ca
Here is the content tree of our site:
If we want to load the home page, our URL is: http://training.valtech.ca
Sitecore typically gets configured to understand the location of your site's homepage and loads it by default when using your base URL.
If you load the Branches page, your URL will appear as:
If you load the New-Brunswick page, your URL will appear as: http://training.valtech.ca/Branches/New-Brunswick.aspx
If you load the Fredericton page, your URL will appear as:
Editing existing item names
It's also important to understand that if a content author changes the name of an existing page, it will change the URL to the page as well as the URL to all children pages. This is an important factor to consider when renaming, especially if you have content that has been around for a while, since links floating around pointing to that content (e.g. links that others create on their sites, pointing to your site) will no longer work. Although Sitecore does have the capacity to lock down this permission, we rarely do so in favour of content author education.
The Page Title field
At Valtech, when you give your page a name, we also auto-fill that name into the Page Title field.
As the note on the field suggests, the content of this field is used to populate the H1 or main heading on your page.
Why don't we just use the item name?
The answer is in the section above. The item name does not allow for special characters which are sometimes included in the main heading of a page.
For example, "Sitecore: A developer's guide" The apostrophe and colon in this heading make it invalid as an item name, but perfectly valid in the "Page Title" field which has no character restrictions.
In addition to special characters, H1 content should be as descriptive as possible to reinforce SEO. This typically means the content is long which is not necessarily appropriate in a URL, especially when we consider pages that are multiple levels deep in your site.