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

How can I unpublish a page?


Go to End
Reply


3 Posts   1415 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, 1831 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.