While developing extensions in Magento 2 or to custom develop some requirements, you may sometimes need to get the list of all CMS pages in admin configuration of which one can select and use. Default Magento doesn’t provide such facility and thus I have come with the tutorial to help you out with this.

Let’s get started with the code to get CMS page list in System –> Configuration:

First of all, go to app -> code -> vendor -> module -> etc -> adminhtml -> system.xml and put below code in the file.

Now put the below code in file app -> code -> vendor -> module -> model -> config -> source -> cms.php

Once you put both the codes as mentioned above, you can see the list of all CMS pages in System -> Configuration of Magento 2.

CMS-page-list-in-system-configuration

Hope this tutorial has helped you implementing in many extensions or to fulfill your custom requirement of CMS page selection. Let me know if you have any doubt or issues regarding, I’ll be happy to assist you any time.

Click to rate this post!
[Total: 5 Average: 4.2]