page publish and unpublished scheduler

Recommended Posts

I've a promotion page that i  want to show on scheduler bases, Lets say i want my page "XYZ" should publish on Thu, 18 at 12:00am and unpublished on Web, 25 at 12:00am. 

is it possible in processwire?

Share this post

Link to post
Share on other sites

I actually have done something similar on a project using the Date/Time, and at the time, a checkbox. However, I have since moved it to 2 Date/Time fields. I simply compared the two, and used an if statement to display the page content if the condition was met. This is rough, but it is similar to what I have done:

$startdate = $page->start_date;
$expirationdate = $page->expiration_date; //you will probably need to use strtotime on these to compare.

if ($startdate <  $expirationdate) {
	//show the desired information
else (
	echo "We're sorry, there are currently no promotions availabe.";

However, I guess this might not suite your needs since the page will still be visible, unless you do some checking in your navigation to show/hide the url with a conditional.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By monchu
      I have launched my martial arts website at
      As a martial arts instructor, my problem was how to track student attendance, payment, course modules, and exercise /health progress report etc. and from my part, I need to publish the class event, schedules, location, and exercise modules for that event. 
      For public viewers, I just simply use blog profile module and UIkit. It's very easy and quick to set-up.
      The purpose of this site is for a logged-in member where from their mobile they can check-in to the available class a day before, and update their health record after the class.
      For user front-end, I'm using <region> and delay output. I found this method is really efficient to manage the HTML output, clean and simple. Less headache with templates structure. 
      Below are the functions and modules of this web apps:
      For Course sessions I'm using page reference, Profields Repeater Matrix and Schedule Pages Module.
      Profields Table to generate the student records and reports.
      Calendar for recurring class sessions through the year based on student ranks, selected by user Roles. I only need a simple calendar function (a quick search from the Internet) that able to receive a month and year input. Then, by using region, events field, Profields Repeater Matrix and URL segment it was reduced my time to code complicated function for the event schedule.
      The only thing here that I have to manage in date calculation is the time format, in Australia we use d-m-y. The tricky thing to get Next month (month + 1), I have to modify it to the first week to get a proper next month.
      To avoid inquiry about forgot password or username, student logs in via Facebook Login module.
      Here is the screenshot of student report: