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.

Archive

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Publishing a page without using CMS


Reply

2 Posts   1363 Views

Avatar
simon_w

21 December 2007 at 6:26pm Forum Moderator, 474 Posts

I am creating a page type for the GHOP that allows you to specify what times the page can be viewed for (see [url]http://code.google.com/p/google-highly-open-participation-silverstripe/issues/detail?id=105[/url] for more information).

I currently have the page become unpublished when it expires, however I need a way to either publish a page or change ShowInMenus without calling the page, as it shouldn't be able to be called.

Avatar
Sigurd

22 December 2007 at 7:29am Forum Moderator, 628 Posts

Are you talking about
a) turning an embargoed page into one that is "normal"?, or
b) turning a "normal" page into an expired one?

If (a), the usability needs a little thought. I don't think we want to turn a page that is merely on the draft site into a published page. The user would need to click 'save and publish' because the user may wish to keep the page on the draft site while editing it etc. Maybe when you clicked save and publish, the message that pops back would be "Page will be brought online on Monday 23rd January 2008" to reinforce whats going to occur. Behind the scenes its up to you how to manage it, but you need to work out if its better to publish the page and add checks all over the place like "show page if expiry is null or expiry is after now()" OR only bring the page online at the right point "some how", e.g. where you do a 404 check or as an extension of DailyTask that runs on a schedule.

(b) should be easy if visiting a page, but be careful that, lets say you have a website with a top menu of "Home About Contact". If "about" has expired and you visit the homepage you need to hide 'about', without the logic being computationally expensive. (hence a where filter at the SQL level seems good)