Jump to:

22977 Posts in 11494 Topics by 2825 members

General Questions

SilverStripe Forums » General Questions » set flag to save and publish page

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 1424 Views
  • dreezy
    Avatar
    Community Member
    9 Posts

    set flag to save and publish page Link to this post

    hello all,

    i put directly with php some html code into a page on de site. (The content of a page)

    But i have to go to my CMS to save and publish the page.

    Is there a table where a flag is set that the page is saved and published?

    So i can do it in my php file?

    Thanx for help

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: set flag to save and publish page Link to this post

    Is there a table where a flag is set that the page is saved and published?

    Published pages are in the SiteTree_Live table vs Draft which are in the SiteTree tables. If you have an object record you want to publish you can do like

    $page->write(); // saves the record
    $page->publish('Stage', 'Live'); // publishes the page

    1424 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.