Adding pages programatically

Help with getting the CMS CORE package up and running. This does not include 3rd party modules, PHP scripts, anything downloaded via module manager or from any external source.
Locked
junkmailtrapenator
New Member
New Member
Posts: 6
Joined: Wed Jul 18, 2007 3:41 pm

Adding pages programatically

Post by junkmailtrapenator »

I'm looking at migrating from an old custom cms to CMS Made Simple. Does any one have any experience with pre-populating CMSMS with old data and can point me in the right direction to get started?

Specifically is there a function or something I can call to easily add a page and/or news item? If not where are all the spots I'd have to touch in the DB?

Thanks,
Pierre M.

Re: Adding pages programatically

Post by Pierre M. »

Hello,

I am not aware of any mass import tool. But there are people trying with success and more to come.
If you know PHP and SQL, I think the CMSms code which creates/updates a page is a good start to learn how to add pages programatically.

Mass content import seems a nice feature for several people, doesn't it ?

Pierre M.
junkmailtrapenator
New Member
New Member
Posts: 6
Joined: Wed Jul 18, 2007 3:41 pm

Re: Adding pages programatically

Post by junkmailtrapenator »

Thanks,

I'm not looking for a "mass import tool" exactly, just something that I could call from an external script. Kinda like addPage($content,$template,$etc);

Not really a requirement for what I'm doing, but it'd be interesting if something like that were implemented as a web service.
jovo
Forum Members
Forum Members
Posts: 30
Joined: Fri Dec 23, 2005 4:10 pm

Re: Adding pages programatically

Post by jovo »

It can be done.

Only 4 tables are involved

I have imported the content of an old site (with CMSMS 0.13) into a new CMSMS 1.0-site in the following way

- exporting with phpmyadmin the tables cms_content and cms_content_props
  - no export of the structure
  - complete INSERT so the fieldnames are included (the layout of the tables are somewhat different)

- dropping the content of these tables in the new database (otherwise duplicate id's appear)

- importing the content via the commandline tool mysql into the new database

- manual adjusting cms_content_seq and cms_content_prop_seq (via phpmyadmin). These rows must contain the largest used contentid. (For one reason or another CMSMS does not use autoincrement fields)

- via the admin panel setting the template of the pages to a correct value

The wanted program should get the following data
- the content-id of the parent
- evt. the template-id although it can be copied from the parent
- the title
- the content of the page
The other data can be retrieved from the database (sequence number, hierarchy) or generated from the supplied data (content_alias,hierarchy_path)

And you must retrieve and modify cms_content_seq and cms_content_props_seq

For a programmer with Perl and Perl::DBI experience: 2-3 hours work
Last edited by jovo on Fri Aug 17, 2007 10:53 am, edited 1 time in total.
Locked

Return to “[locked] Installation, Setup and Upgrade”