I need show the product and Version from the below folder structure. Please help to achieve on this.
Sitecore Folder Structure
So far I wrote some code for review
var item = ItemHelper.GetChildItems("{D25F6421-4578-4EB2-8C6D-C9BE2C355099}");
public static IEnumerable<Item> GetChildItems(string itemId)
{
var sitecoreItem = Sitecore.Context.Database.GetItem(new ID(itemId));
if (sitecoreItem.HasChildren)
{
return sitecoreItem.GetChildren().InnerChildren;
}
return null;
}
var productList = item.Where(x => x.Fields["ProductTitle"] != null).Select(y =>
new Product
{
Name = y.Name,
Id = y.ID,
ProductTitle = y.Fields["ProductTitle"].Value,
Version = y.GetChildren().InnerChildren
});
I need version list also to bind.