Reputation: 959
I want to get an array of all the sibling items of the current item so that I can display the thumbnails in them. how can I achieve this?
Thanks in advance.
Upvotes: 2
Views: 1902
Reputation: 27132
You can get parent item of the current item and then take all its children except from the current item.
You can use code below:
Item currentItem = Sitecore.Context.Item;
Item[] siblings = currentItem.Parent.GetChildren().Where(c => c.ID != currentItem.ID).ToArray();
Upvotes: 8