Image Library Sub Folder

Posted by Community Admin on 03-Aug-2018 03:34

Image Library Sub Folder

All Replies

Posted by Community Admin on 05-Jul-2013 00:00

Hi Telerik Team

I would like to select Image Library Sub Folder instead of select top level Image Library.

1.var album = App.WorkWith().Albums().Where(a => a.Title.Equals("Rotate Image")).Get().FirstOrDefault();
2.if (album != null)
3.
4.   RadRotator1.DataSource = album.Images().Where(x => x.Status == ContentLifecycleStatus.Live).OrderBy(x => x.Ordinal).ToList();
5.   RadRotator1.DataBind();
6.

If Title == "Images" all images coming out, but if Title == "Rotate Image", album == null, why?
In Rotate Image library have 3 images.
Thanks in advance.
Terry

Posted by Community Admin on 08-Jul-2013 00:00

Hello Terry,

For the need of hierarchy we have now Libraries on the top and Folders where each child of the Library that is a container for media content is called Folder. A library is a container for files with specific extensions, generally called images, documents and videos. 

A folder is a container for the media content but will have only structural presence. Folders do not have permissions, multiple urls etc.

To manage folders, you use LibrariesManager.

So, your code should be something like this:

LibrariesManager albumsManager = LibrariesManager.GetManager("OpenAccessDataProvider");
var library = albumsManager.GetAlbum(LibrariesModule.DefaultImagesLibraryId);
 
var folder = albumsManager.GetChildFolders(library).Where(f => f.Title == "Rotate Image");

Here is the Folder API:
http://www.sitefinity.com/documentation/documentationarticles/managing-folders

Hope this helps.

Regards,
Veselin Vasilev
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 Public Issue Tracking system and vote to affect the priority of the items

This thread is closed