Canonical URLs

Sitefinity CMS keeps track of each content item and the default page where it is displayed. This way, Sitefinity CMS knows the URL of each item at any time, regardless of whether the item is published or saved as draft. This is called Canonical URL service. It makes possible for you to preview an item, as it will appear on the website, even before the item is published. Also, each item, at any time has one default page associated with it, therefore its URL is always known.

PREREQUISITES: The default location of an item must be a page that is accessible by all users, that is, they have permissions to view it.

Content items are displayed on pages using widgets. Each type of content item has one or more widgets used to display it. For example, events are displayed on the website using the Eventswidget. A page is associated with a content item when you drop the respective widget on the page.

EXAMPLE: You create three events, but you have no page where you have added the Eventswidget. These events do not have a default page, because they are not displayed anywhere on the site. You cannot preview the events, because Sitefinity CMS does not know where they will be displayed. You cannot know their exact URL, because it depends on the page where they will be published. 
When you create a page and add the Eventswidget on the page, this page automatically becomes the default page for the events that you have created. If you, however, configure this Eventswidget to display only one of the three created events, this page becomes default only for the event that it displays. For example, you can use categories to narrow the displayed events. If you create a second page, which also contains the Eventswidget, you can set manually, which is the default page for the events, using priorities.

PREREQUISITES: Before you configure default pages for content items, you must configure canonical URLs service.
For more information, see Administration: Enable and disable Canonical URLs service.

Configuring the default pages

You can configure default pages on content type level.

To view and configure the default pages for all content items of a particular type, perform the following:

  1. Open the page for the content type.
    For example, open the Eventspage.

  2. In the lower-right corner of the page, click Pages where <Content type name> are published.
    For example, Pages where Events are published.

    You can see a page, displaying all pages where the respective widget is dropped and configured to display the content type.
    For example, all pages that contain the Eventswidget.

  3. To set the priority, click the Actionslink of a page and use the Up or Down functions.
    The page on the top is the one with highest priority. The page with highest priority is the default page.

    For example, if two pages are configured to display all events, the default page for all events is the page whit the higher priority. However, if you have two pages, of which one is configured to display only events from Sportscategory and the other – only events from Businesscategory, the default page for events with Categoryset to Sportswill be the first page and for the business events will have the second page, even if you have set the first page with higher priority.

NOTE: The default page for a content item is the page with the highest priority, where this item is displayed. If there is a page with higher priority that has the respective widget, but is not configured to display the content item, it is not set as its default page.

NOTE: If you have multiple sites, and the content items of one site are displayed on pages of another site, these pages also appear on the list of default pages for the items and you can set their priority. For more information about multiple sites and multiple data sources, see Create sites.

For example, if you configure the provider for events of site A to be also the provider for the events in site B and you create a page that has the Eventswidget in site B and this widget is configured to display the events created in site A, when you go to site A and open the page with the list of default pages for events, the page from site B will also be present in the list and you can set it as page with highest priority. This way, an event from site A can open by default on a page from site B.

Previewing an item and viewing its default pages

You can preview an item in one of the following ways:

  • On the home page of the content type, click Actionslink of the respective content item and then click View.
  • When you are creating or editing a content item, in the toolbar, click Preview.

The item opens in its default page. If the item is not displayed anywhere on the site and does not have a default page, you cannot view or preview it.

When you open an item for editing, you can view the pages where it appears by expanding Pageson the right. The page on the top of the list is the default page for the item.

Scope of Canonical URLs

Content types that are covered by the feature are:

  • News
  • Event
  • Blog Post
  • Image
  • Video
  • Document & File
  • List Item
  • Ecommerce Products
  • Dynamic content types
  • Forums posts are only partially covered by the feature – they have canonical meta tags inserted, but the preview is not available for them.
Want to learn more?
Enhance your Sitefinity skills by enrolling in free training sessions. Become Sitefinity certified through Progress Education Community to strengthen your professional credentials.