Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » adding pages directly to the database

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

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

Page: 1
Go to End
Author Topic: 1433 Views
  • Nicolaas
    Avatar
    Forum Moderator
    213 Posts

    adding pages directly to the database Link to this post

    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

  • Sam
    Avatar
    Administrator
    679 Posts

    Re: adding pages directly to the database Link to this post

    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.

  • Ingo
    Avatar
    Forum Moderator
    801 Posts

    Re: adding pages directly to the database Link to this post

    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.

    1433 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.