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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

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

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

Publishing a page without using CMS


Go to End


2 Posts   1676 Views

Avatar
(deleted)

Community Member, 473 Posts

21 December 2007 at 6:26pm

I am creating a page type for the GHOP that allows you to specify what times the page can be viewed for (see http://code.google.com/p/google-highly-open-participation-silverstripe/issues/detail?id=105 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

Forum Moderator, 628 Posts

22 December 2007 at 7:29am

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)