How to create a document library under a parent libray by ap

Posted by Community Admin on 04-Aug-2018 14:59

How to create a document library under a parent libray by api

All Replies

Posted by Community Admin on 27-May-2015 00:00

Hi all,

I am working with sitefinity 7.0.

I am working on creating and uploading document to library by api in sitefinity.

Suppose I have 2 document libraries say Group1,Group2 under the root
Default Library.

 

How can i upload documents to the library Group1,Group2 under the Default Library.

I am referring the code here .

//Set the parent document library.
DocumentLibrary documentLibrary = librariesManager.GetDocumentLibraries().Where(d => d.Id == parentDocumentLibraryId).SingleOrDefault();
document.Parent = documentLibrary;

 But ​how can i found the Id of the document library Group1 under Default Library by its name?

 because the librariesManager.GetDocumentLibraries() returns only libraries in root level.

 What i need is the documentLibrary which has name Group1 under parent Default Library.

 

Any way to achieve this?

Thanks

 

 

 

Posted by Community Admin on 01-Jun-2015 00:00

Hello,

When working in the context of hierarchical libraries, only the libraries on the root level are referred to as libraries. Their children are folders(http://docs.sitefinity.com/for-developers-library-folders). To get all folders in a parent library/folder, you can use the approach described here:http://docs.sitefinity.com/for-developers-get-folders.

Regards,
Atanas Valchev
Telerik

 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

This thread is closed