Thursday, July 29, 2010

Sitecore TreeList Items

Straightforward Sitecore one.

If you have a treelist in your item, to access them without going through the rigmarole of splitting the guids up, use the following:


 MultilistField Tags = Sitecore.Context.Item.Fields["Product Tags"];

 Item[] TagList = Tags.GetItems();

2 comments:

  1. I found this post very helpful. Before, I was trying to create an array of items without populating the multilist field (in one step) and was wondering why the GetItems() wasn't working.. Much appreciated++

    ReplyDelete