Web Analytics

Fill the form & Get Installation Support

How to get CMS Block Collection in Magento 2

You can get all the CMS Static Blocks collection in Magento 2 by using interface, Magento\Cms\Api\BlockRepositoryInterface.

Magento\Cms\Api\BlockRepositoryInterface is used for getting CMS Static Blocks related data in Magento 2.

You need to instantiate Magento\Cms\Api\BlockRepositoryInterface in __construct() method of Class

From Template file, you can access all the Static Blocks by iterating over a loop on a collection.

After using the above code snippet you can get all the Cms Static Blocks from a store.

Fill the below form if you have any Magento programming need.





    Recent Articles

    Author Info

    Author Image

    Magento Developer

    Hire S. Gorjia

    Get a Free Quote





      /* second popup */

      Connect With Us