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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

set flag to save and publish page


Go to End


2 Posts   3533 Views

Avatar
dreezy

Community Member, 9 Posts

30 December 2010 at 9:52am

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

Avatar
Willr

Forum Moderator, 5523 Posts

1 January 2011 at 6:17pm

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