Nested Image libraries issues/help

Posted by Community Admin on 04-Aug-2018 15:41

Nested Image libraries issues/help

All Replies

Posted by Community Admin on 14-Jul-2014 00:00

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

At the root level: 

Brand1_library

Brand2_library

Brand3_library

Brand4_library

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!

Posted by Community Admin on 17-Jul-2014 00:00

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.

Regards,
Nikola Zagorchev
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