Definition aliases

Abstract

A definition's alias is the culture-independent name of a definition.

A definition’s alias is represented by the definition’s item name in Sitecore and is the culture independent name of a definition. In the following example, the goal’s alias is My goal name and its English name is English goal name. Culture-specific names are represented by the Name field on the item as shown:

aliases1.png

You must specify an alias and a culture-specific name each time you create a definition.

Guid goalId = Guid.NewGuid(); // Goal ID
CultureInfo goalCulture = new CultureInfo("es"); // Goal culture
string goalName = "Newly created goal"; // Goal name
DateTime creationDate = DateTime.UtcNow; // Goal creation date
string createdBy = "sitecore\admin"; // Goal creator
var goalAlias = "Newly created item name/alias"

Sitecore.Marketing.Definitions.Goals.GoalDefinition goal = new Sitecore.Marketing.Definitions.Goals.GoalDefinition(goalId, goalAlias, goalCulture, goalName, creationDate, createdBy);

Alias uniqueness and validation

Aliases must be unique within definition types. For example, you can have a goal named “Hello World” and a campaign named “Hello World”, but you cannot have two campaigns named “Hello”. This is true even if the campaigns are created in different parts of the content tree.

Aliases are validated against the following regular expression: ^[a-zA-Z0-9_\-\x20]*$