More in this section

Forums / Developing with Sitefinity / Nested Image libraries issues/help

Nested Image libraries issues/help

2 posts, 0 answered
  1. Phani
    Phani avatar
    9 posts
    18 Mar 2014
    14 Jul 2014
    Link to this post

    In Sitefinity Image libraries I have this scenario(nested libraries):

    At the root level: 





    Under each Brand library I have another set of sub libraries with the same name:

    Shirts, Pants, Accessories, Jackets etc.

    And under each of these libraries I have two sub-libraries with the same name:

    Large, Small

    Large and Small libraries hold the regular and the thumbnail images.

    On my website page I would programmatically know, which brand and which product images to display. Not all product types are to be shown for all brands.

    How do I access all libraries within brand libraries and so on until I reach the images at level 3?

    Depending on the brand, I have tried librariesmanager.getalbums().Where(a=>a.title=="brand1_library") which would return the top root level album for me. From there I am not sure which way I need to go to get sub-libraries of the top level libraries.

    Any help or direction is appreciated. Thanks!

  2. Nikola Zagorchev
    Nikola Zagorchev avatar
    424 posts
    19 Apr 2017
    17 Jul 2014
    Link to this post
    Hello Phani,

    You can use the GetAllFolders method to get all child libraries of a parent folder:
    var parent = manager.GetFolder(Id);
    var children = manager.GetAllFolders(parent);
    You can find more information on querying albums and folders in a bottom section in this blog post. It is described how to get all nested libraries and query images from them.

    Nikola Zagorchev
    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
2 posts, 0 answered