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.

General Questions /

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

How can I unpublish a page?


Reply


3 Posts   1091 Views

Avatar
DeklinKelly

Community Member, 197 Posts

17 August 2010 at 8:25am

This does NOT unpublish a page:

$page->Status = 'Unpublished';
$page->choose_site_stage ('Stage');
   $page->flushCache();

Avatar
swaiba

Forum Moderator, 1799 Posts

17 August 2010 at 8:45am

How about...

$page->doUnpublish();

Avatar
DeklinKelly

Community Member, 197 Posts

17 August 2010 at 10:41am

That works, thanks.