Requirements
Editors should be able to define special URLs to special content objects which are easy to remember.
Solution
Vanity URLs are special human readable URLs which do not contain any technical identifiers like document IDs. CoreMedia Blueprint provides a means to assign vanity URLs to content objects.
Vanity URLs are configured in channel settings. Typically, there is one Vanity URL settings document
for the root channel of a given site. This is the setup chosen for CoreMedia Blueprint
demo content. To find the Vanity URL settings document, open the root channel of a
site and switch to the Settings
tab. You will find the Vanity URL settings document link inside
the Linked Settings
section.
Vanity URLs are defined as a relative URI path. The path might consist of several segments, but if you would like
keep your Vanity URLs simple, just use only one path segment. The URI path is then prepended with a path segment
consisting of the site name. For example, for the site perfectchef
, a URI path of my/special/artilce
would yield the Vanity URL /perfectchef/my/special/article
.
To add a Vanity URL for a document, follow these steps:
Select the
StructListProperty
vanityUrlDefinition
and create a new child Element Struct by clicking the [Add item to List Property] symbol in the toolbar.Create a new
LinkProperty
and name it "target".Set the content type field to the type of your target document.
Click on the value field, this will open the library window. Drag your target document from the library window into the value field.
Create a
StringProperty
, name it id and type your vanity URI path inside the value field.
Once the settings document is published, the new Vanity URL is reachable on the live site, and it is used for all generated links referring to the target document.