public static string GetTileRoot(this MapTiles part) { var mediaField = part.Get<MediaField>(Constants.TilesMediaFileFieldName); if (mediaField == null || !mediaField.Paths.Any()) { return null; } return Path.Combine(Path.GetDirectoryName(mediaField.Paths[0]), part.ContentItem.ContentItemId); }