Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

adding pages directly to the database


Reply

3 Posts   1455 Views

Avatar
Nicolaas

22 May 2007 at 11:12am Forum Moderator, 213 Posts

Hi Folk

I am putting together a large site and I would to add pages directly to the database rather than adding them through the CMS interface.

If I just create a temporary php page that connects to the database and runs "INSERT INTO SiteTree_Live ...... " statements then would I get in trouble or would this just work?

Thanks a million

Nicolaas

Avatar
Sam

22 May 2007 at 12:25pm Administrator, 685 Posts

You should use INSERT INTO SiteTree

And then visit admin/publishall to publish all the pages to SiteTree_Live

If you have any custom fields in, for example, Page, you will need to go INSERT INTO Page as well.

Avatar
Ingo

22 May 2007 at 1:26pm Forum Moderator, 801 Posts

Unless its really performance-critical, i'd rather bump up the available PHP-memory and create SiteTree-objects. There's just too much stuff in SiteTree/Hierarchy to bypass the model-layer and do everything yourself (especially when you want to publish pages etc.).
If you have access to a shell on your webserver, webhosts often grant more execution time and memory if you execute a php-script on commandline.