Skip to content

Instantly share code, notes, and snippets.

@willboudle
Last active January 3, 2016 01:59
Show Gist options
  • Select an option

  • Save willboudle/8392554 to your computer and use it in GitHub Desktop.

Select an option

Save willboudle/8392554 to your computer and use it in GitHub Desktop.
Create CMS Page programmatically - Magento
<?php
// Create a new cms page for a .
$cmsPageData = array(
'title' => 'Test CMS Page Title',
'root_template' => 'one_column',
'meta_keywords' => 'meta,keywords',
'meta_description' => 'meta description',
'identifier' => 'this-is-the-page-url',
'content_heading' => 'content heading',
'stores' => array(0),//available for all store views
'content' => "Hello I'm a new cms page."
);
Mage::getModel('cms/page')->setData($cmsPageData)->save();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment