4

I have 50 CMS pages I want to create in Magento. These are essentially mail merges off of a database with different content (but same structure) in each, so I'd love to be able to import them if possible. I want individual pages so they can be indexed by the search engines. Is there a handy/dandy way to do this?

I could alternatively do it with CMS blocks and categories as well if that is easier. (which will also give me the option of plopping related products in as well.)

Thanks in advance for your help.

Mohsen Nosratinia
  • 9,844
  • 1
  • 27
  • 52
Matt
  • 43
  • 1
  • 3

4 Answers4

5

At the moment, there is no easy way to import CMS content into Magento. Neither dataflow nor the webservices contain profiles that would help here. On the other hand, the CMS pages and blocks are contained in only a few tables, so you may be able to import them using PHP (or whatever your language of choice is). Take a look in the database at the following tables:

cms_page
cms_page_store
cms_block
cms_block_store

Hope that helps. Thanks, Joe

Joe Mastey
  • 26,809
  • 13
  • 80
  • 104
4

You can simply use SSH command for export/import of CMS pages / Static Blocks as:
1> Export

mysqldump -u [username] -p[password] [database] cms_page cms_page_store cms_block cms_block_store | grep INSERT | sed 's/INSERT INTO/REPLACE INTO/' > cms-export.sql

2> Import

mysql -u [username] -p[password] [database] < cms-export.sql

For more info, you can refer to the following blog article:
http://www.blog.magepsycho.com/export-import-cms-pages-static-blocks-via-ssh/

Let me know if that works for you. Good Luck!

MagePsycho
  • 1,944
  • 2
  • 29
  • 60
0

you could also easily create a new module to house the imported data, it would allow more versatility in the end as far as management of data. modules are very easily built as long as you understand the magento structure.

Matt
  • 89
  • 1
  • 4
0

I got a fantastic answer to this question using PHP on stackoverflow:

Programmatically creating a CMS/Page in Magento

Hope this helps.

-Kyle

Community
  • 1
  • 1
KyleDugger
  • 208
  • 1
  • 3
  • 9