Get CMS Page collection by URL Key in Magento 2

You can get specific CMS page collections in Magento 2 by calling interface, Magento\Cms\Api\PageRepositoryInterface.

PageRepositoryInterface is used when you need to fetch a collection of CMS pages or get specific CMS page data.

You need to instantiate PageRepositoryInterface in __construct() method of Class.  If you want to Get All CMS Pages Collection refer to Get All CMS Pages Collection Magento 2

Continue reading “Get CMS Page collection by URL Key in Magento 2”

Get CMS Page Collection in Magento 2

You can get all the CMS page collection in Magento 2 by calling interface, Magento\Cms\Api\PageRepositoryInterface.

PageRepositoryInterface is used when you need to fetch a collection of CMS page or get specific CMS page data.

You need to instantiate Interface in __construct() method of Class.

Continue reading “Get CMS Page Collection in Magento 2”

How to set meta title, keywords, description and page title for a page programmatically in magento 2?

You can set Page Title and Page Browser Title separately using Magento 2.
If you want to set Different Page title and browser tab title you need to do using programmatically.

You can do it via Either Block prepareLayout() function or Controller execute() function.

You can set custom Page Title, Meta Title, Meta Description, Meta Keywords for any page using programmatically. Continue reading “How to set meta title, keywords, description and page title for a page programmatically in magento 2?”