2

Is there a way to get all pages with certain layout?

What I want to achieve is to print all pages that have layout named "page with left sidebar" for example.

I'm new in Magento (in php also :D) so any help would be greatly appreciated.

2

You'll need to filter the cms/page collection by root_template:

$cmsPageCollection = Mage::getResourceModel('cms/page_collection')
    ->addFieldToFilter('root_template', 'two_columns_left');
1

Hi you can all cms by cms/page collection

$cmsPages=Mage::getResourceModel('cms/page_collection')
foreach($cmsPages as $eachPage){
var_dump($eachPage)
}

get individuals page by

$cms = Mage::getModel('cms/page')->load(cmspageindenfiername, 'identifier');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy