Developer forum

Forum » Development » How to get items from nameditemlist

How to get items from nameditemlist

Lars Larsen
Reply

Hi
Is it possible to retrieve all items in a nameditemlist by the API? If so how?


Replies

 
Lars Larsen
Reply

Found this post where Adrian links to this page where there is an example:

var comments = NamedItemList.GetNamedItemListByName("Comments", NamedItemList.ListSourceType.Page, Pageview.Page.ID);
if (comments != null && comments.ItemList != null && comments.ItemList.Relations != null && comments.ItemList.Relations.Any())
{
      <section class="comments">
      @foreach (Item comment in comments.ItemList.Relations)

 

You must be logged in to post in the forum