public ActionResult Index() { var response = new List <BucketResponse>(); var buckets = BucketsHelper.GetAllBuckets("/sitecore/content/"); foreach (var bucket in buckets) { response.Add(new BucketResponse { BucketId = bucket.ID.Guid, BucketName = bucket.DisplayName }); } return(View(response)); }
public ActionResult GetBuckets() { var response = new List <BucketResponse>(); var buckets = BucketsHelper.GetAllBuckets("/sitecore/content/"); foreach (var bucket in buckets) { response.Add(new BucketResponse { BucketId = bucket.ID.Guid, BucketName = bucket.DisplayName }); } return(Json(response, JsonRequestBehavior.AllowGet)); }
public ActionResult GetBucketableItems(string bucketId, string name = null) { var response = new List <BucketableResponse>(); var bucketItemId = new ID(bucketId); var bucketableItems = BucketsHelper.GetItemsFromBucket(bucketItemId, name); foreach (var bucketable in bucketableItems) { var fields = BucketsHelper.GetTemplateFields(bucketable); response.Add(new BucketableResponse { BucketId = bucketItemId.Guid, ItemId = bucketable.ID.Guid, ItemName = bucketable.DisplayName, Url = BucketsHelper.GenerateFieldEditorUrl(bucketable, fields), Fields = fields }); } return(Json(response, JsonRequestBehavior.AllowGet)); }