Data Patch

Get cms block by identifier – Magento 2

Get cms block by identifier – Magento 2

3 years ago
For that, you can use Magento\Cms\Api\GetBlockByIdentifierInterface. No need to use Magento\Framework\Api\SearchCriteriaBuilder. /** * @var \Magento\Cms\Api\GetBlockByIdentifierInterface */ private $blockByIdentifier; public function __construct( GetBlockByIdentifierInterface $blockIdentifier ) { $this->blockByIdentifier = $blockIdentifier } Now you can get that page data passing blockIdentifier and storeId. $this->blockByIdentifier->execute($blockIdentifier, $storeId);  
Read More

Get cms page by identifier – Magento 2

3 years ago
For that, you can use Magento\Cms\Api\GetPageByIdentifierInterface. No need to use Magento\Framework\Api\SearchCriteriaBuilder. use Magento\Cms\Api\GetPageByIdentifierInterface. /** * @var \Magento\Cms\Api\GetPageByIdentifierInterface */ private $pageByIdentifier; public function __construct( GetPageByIdentifierInterface $pageByIdentifierInterface ) { $this->pageByIdentifier = $pageByIdentifier } Now you can get that page data passing pageIdentifier and storeId. $page = $this->pageByIdentifier->execute($pageIdentifier, $storeId);    
Read More

Create your account

chatsimple