0

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?

enter image description here

6
  • 2
    Does this answer your question? I am trying to get all the folder inside publication but getting some error
    – Neil
    Jun 9 at 12:20
  • Check my previous answer and remove recursive: true. Jun 9 at 21:06
  • 2
    Might 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 at 7:10
  • hheehehhe yeah :D Jun 10 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 Gour
    Jun 13 at 14:35

1 Answer 1

3

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);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.