Posted on 25/05/2015 08:54:16
Greetings.
I am not sure I am fully understand the result, which you are desired to get.
If you wanted to get count for all paragraph items at the page you can use something like that :
@{ var count = 0;
var paragraphs = Dynamicweb.Content.Paragraph.GetParagraphsByPageID(GetInteger("Global:Page.ID"));
foreach (Dynamicweb.Content.Paragraph p in paragraphs ){
if(!String.IsNullOrEmpty(p.ItemType)){
var items = Dynamicweb.Content.Items.ItemManager.Storage.GetByParagraphId(p.ItemType, p.ID);
count += items.Count();
}
}
}
Items Count : @count
Also you can get item inside paragraph template, but this probably always return only 1 item:
@{ var items = Dynamicweb.Content.Items.ItemManager.Storage.GetByParagraphId(GetString("Item.SystemName"), GetInteger("Global.ParagraphId"));
var count = items.Count();
}
Items Count @count
If it doesn't solve your problem reply here, I'll try to find out another solution for it
DynamicWEB Software A/S, Russian team