How to get current CMS page id in Magento2

Magewallet | Magento 2 Extensions, Themes & Solutions

How to get current CMS page id in Magento2

To get the id of current CMS page in Magento 2, use the following code snippet.

There are so many other methods to get CMS page details like title, identifier, content, and content heading. Lets check one by one.

To get the identifier of the current CMS page you can use

To get the Page Title :

To get the Page Content :

To get the Page Content Heading:

Thats it. Enjoy Magento 2!! Enjoy Magewallet!!!

admin

2 Comments

Paul


Warning: A non-numeric value encountered in /home/nimeshm2/magewallet.com/wp-includes/formatting.php on line 3623
34 mins ago

Where do I write this piece code? Thanks

admin


Warning: A non-numeric value encountered in /home/nimeshm2/magewallet.com/wp-includes/formatting.php on line 3623
34 mins ago

Hi Paul, You can use this code snippet with any helper or block file. Let us know if you need more details for the same. Thanks

Leave Comment

Newsletter

Latest Tweets