I am trying to get Folders just inside the publication not all the folders in the publication Is there any way we can do it?
-
2Does this answer your question? I am trying to get all the folder inside publication but getting some error– NeilJun 9, 2022 at 12:20
-
Check my previous answer and remove recursive: true.– Marko Milic ♦Jun 9, 2022 at 21:06
-
2Might be important to mention that in the screenshot above there is only one folder: Building Blocks. The rest are different types of objects, if you're trying to get those too then you may want to look at their types and look up the logic to fetch them.– Nuno Linhares ♦Jun 10, 2022 at 7:10
-
hheehehhe yeah :D– Marko Milic ♦Jun 10, 2022 at 10:34
-
@Neil it's giving all the folders inside the publication I just want child folder or the Folder only one level down– Sneh GourJun 13, 2022 at 14:35
1 Answer
As Marko suggested use the RepositoryItemsFilterDatafilter but dont set Recursive.
var client = // Get your client how ever you prefer
var filter = new RepositoryItemsFilterData {
ItemTypes = new[] { ItemType.Folder }
};
// Pass publication Id
client.GetListXml("tcm:0-233-1", filter);