Sitecore 5.0 API

ItemPath.Path Property

Gets the path.

[Visual Basic]
Public ReadOnly Property Path As String
[C#]
public string Path {get;}

Remarks

A path identifies an item. A path can be an ID or a sequence of item names or IDs. If a path starts with a slash (/) it is an absolute path that is resolved from the root element of the database. If not, it is a relative path that is resolved from the current context item.

The path is always an absolute path from the root element of the database.

Example

The following example determines if an item is a layout.

{{
public bool IsLayoutItem(Item item) {
  if (item != null) {
    string path = item.Paths.Path;
    return path.StartsWith("/sitecore/layout");
  }
  return false;
}
}}

See Also

ItemPath Class | Sitecore.Data Namespace