Try Now
More in this section

Forums / General Discussions / Image Library Sub Folder

Image Library Sub Folder

2 posts, 0 answered
  1. Terry
    Terry avatar
    3 posts
    26 Feb 2013
    05 Jul 2013
    Link to this post
    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)
    4.   RadRotator1.DataSource = album.Images().Where(x => x.Status == ContentLifecycleStatus.Live).OrderBy(x => x.Ordinal).ToList();
    5.   RadRotator1.DataBind();

    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.
  2. Veselin Vasilev
    Veselin Vasilev avatar
    23 posts
    27 Jul 2015
    08 Jul 2013
    Link to this post
    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:

    Hope this helps.

    Veselin Vasilev
    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
2 posts, 0 answered