Get all blocks of specific category



I would like to get all the blocks of specific category. 

Editors will choose category when creating blocks in different folders by using specific block type.  Is there any better way to get the block list based on category ID/Name ?

Any help would be much appreciated. 



#190720 Apr 16, 2018 13:40
  • David Knipe
    Member since: 2008

    Hi Suresh

    Does your solution use Episerver Find?


    #190781 Apr 16, 2018 21:03
  • valdis iljuconoks
    Member since: 2011

    if performance is secondary here, you can recursevily travel content tree and collect all blocks with that/those specific category(-ies). code should be quite simple (walking around the tree and asking for child items). but agree with David - you should look for some better options..

    #190788 Apr 16, 2018 22:04

    Thanks David and Valdis for your response.


    I'm currently using Alloysite for exploring this. Yes Episerver find is there in my solution. Can you please guide me how this can be done using Episerver Find ?


    I'm new for Episerver, Could you please help me with the code snippet ?



    #190802 Apr 17, 2018 10:57
  • Aniket
    Member since: 2015

    Taking a step back what are you trying to accomplish? Can you provide a use case?

    Categories are most useful on pages like press releases, so you can filter content by tags etc. 

    Maybe there is an alternate more effective solution than categorizing blocks?

    #190869 Apr 17, 2018 23:08