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, 2022 at 12:20
  • Check my previous answer and remove recursive: true.
    – Marko Milic
    Jun 9, 2022 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, 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 Gour
    Jun 13, 2022 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 and acknowledge that you have read and understand our privacy policy and code of conduct.

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