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   1064 Views

Avatar
DeklinKelly

17 August 2010 at 8:25am Community Member, 197 Posts

This does NOT unpublish a page:

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

Avatar
swaiba

17 August 2010 at 8:45am Forum Moderator, 1796 Posts

How about...

$page->doUnpublish();

Avatar
DeklinKelly

17 August 2010 at 10:41am Community Member, 197 Posts

That works, thanks.