Posted on 06/11/2015 14:57:26
Hi Rene
I think you have to create a custom item, that uses a Paragraph template that points to your existing ItemPublisher template.
Something like:
@{
var pageSize = GetInteger("Item.PageSize"); // here you decide how many you want to show
var sourceAreaId = GetInteger("Item.SourcePageId"); // save which area id you want to use (the page where your items are located)
string filterValue = string.Empty;
var excludedLoop = GetLoop("chosenItems"); // this should be from DW where you can create a list of numbers in your item that is using the custom RenderItemlist Paragraph template
foreach (var item in excludedLoop) {
filterValue += "Id !=\"" + item.GetString("Item.Id") + "\" and"; // before this you should do a check where you do not add "and" to the last item in your loop, you can check if count matches the length of the loop
}
filterValue = "\"@\"" + filterValue + "\"\""; // this would generate a list looks like @"ItemId!=1 or ItemId!=2 or Item!="3"
RenderItemList(new
{
ItemType = "ItemName", // ItemName should be replaced with the correct system name
ListSourceType = "Page",
ListSourcePage = sourceAreaId,
IncludeAllChildItems = true,
ItemFieldsList = "*",
ListTemplate = "ItemPublisher/List/EventListWithoutFilters.cshtml",
ListPageSize = pageSize,
Filter = filterValue,
ListOrderBy = "Date", // date is an item property, you can replace it with whatever you want
ListOrderByDirection = "ascending"
})
}
I have not tested this, but it should work :)
Best regards,
Bogdan