Bulk import a Magento CMS page (or block)

I have 50 CMS pages that I want to create in Magento. This, in fact, mail combines the database with different content (but with the same structure) in each, so I would like, if possible, import them. I want individual pages so they can be indexed by search engines. Is there any convenient / dandy way to do this?

I could also do this with CMS blocks and categories, if that is easier. (which will also give me the opportunity to also connect related products.)

Thanks in advance for your help.

+4
source share
4 answers

There is currently no easy way to import CMS content into Magento. Neither data flow nor web services contain profiles that could help here. On the other hand, CMS pages and blocks are contained in only a few tables, so you can import them using PHP (or whatever your language of choice). Take a look at the database in the following tables:

cms_page cms_page_store cms_block cms_block_store 

Hope this helps. Thanks Joe

+5
source

You can simply use the SSH command to export / import CMS / Static blocks pages like:
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 information, 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 this works for you. Good luck

+4
source

You can also easily create a new module for hosting imported data, which ultimately provides greater versatility with respect to data management. Modules are very easy to create if you understand the magenta structure.

0
source

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

Programmatically creating a CMS / page in Magento

Hope this helps.

-Kyle

0
source

Source: https://habr.com/ru/post/1301487/


All Articles