Hi,
We can easilly access an item list loop within the master and layout template, but within another template we cannot (example, product template).
How can we access that data in a loop within Pageview.Area.Item?
Right now we we have to do this:
string str_social = Pageview.Area.Item["Social"] != null ? Pageview.Area.Item["Social"].ToString() : ""; foreach (var socialID in str_social.Split(',')) { var item = Dynamicweb.Content.Items.ItemManager.Storage.GetById("Social", socialID.ToString()); if (item != null) { // do something } }
The problem is that this will make a DB call for each loop interaction and if we have multiple item lists, the problem grows.
Best Regards,
Nuno Aguiar