To get the id of current CMS page in Magento 2, use the following code snippet. protected $_page; public function __construct( … \Magento\Cms\Model\Page $page, … array $data = [] ) { parent::__construct($context, $data); … $this->_page = $page; … } if ($this->_page->getId()) { $pageId = $this->_page->getId(); } There are so many other methods to get CMS…


Recent Comments