Accessing block by folder name

Vote:
 

Hi,
]
I am using the latest version of episerver through nuget package ii.e. 8.8.0.0.
I have a requirement to access folder structure which contains shared blocks and each block has content area which contains nested block and are of type CategoryBlock.   A
My folder under Block asset pane are  
  Navigation Folder -> has one navigation block which has a content area, and each content area, has nested blocks. 

Question is to pick the Navigation Block from Navigation folder, Can I access the that directly rather than dragging this shared block to any page.
Basically I would like to access the block using the Folder structure i.e. Navigation Folder.
Can you suggest a code snippet please?
Hope i have explained it well. 

Thanks,
Naz

#133863
Sep 13, 2015 11:20
Vote:
 

The media and folder structure is IContent. If you go into admin mode and set access rights you can navigate the strucutre to get the id of your folder.

I did a small tool last year for copying blocks from a folder wich might give you some help on the way. Im not sure wich version of EPi that I used so accessing folders and loading blocks might have changed.

http://world.episerver.com/code/Per-Nergard/Block-test-pages-generator/

#133867
Sep 13, 2015 19:44