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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

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

How can I unpublish a page?


Go to End


3 Posts   1987 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, 1899 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.