How to list the existing Components of a Folder using WebDAV URL in Tridion?

StackOverflow https://stackoverflow.com//questions/9597208

  •  08-12-2019
  •  | 
  •  

Pregunta

Can you please explain how to get the list of Components in a Folder based on it's WebDAV URL in C# by using Tridion's TOM.NET API.

¿Fue útil?

Solución

var folder = (Folder) session.GetObject("/webdav/Test/Building%20Blocks/Default%20Templates");
var filter = new OrganizationalItemItemsFilter(session);
var listXml = folder.GetListItems(filter);

The GetItems method will return you a list of objects while GetListItems returns an XML element. Depending on the version of Tridion you are using you might not have GetItems method implemented yet

You can set additional properties on filter variable.

Otros consejos

List<RepositoryLocalObject> myLookComponentList = 
     (List<RepositoryLocalObject>)folder.GetItems(filter).ToList();
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top