zaib Posted October 12, 2017 Share Posted October 12, 2017 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? Link to comment Share on other sites More sharing options...
abdus Posted October 12, 2017 Share Posted October 12, 2017 There are modules you can use: https://modules.processwire.com/modules/schedule-pages/https://modules.processwire.com/modules/publish-date/ 1 Link to comment Share on other sites More sharing options...
louisstephens Posted October 12, 2017 Share Posted October 12, 2017 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: <?php $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. Link to comment Share on other sites More sharing options...
cleanboy3000 Posted July 25, 2019 Share Posted July 25, 2019 So I'm resurrecting this thread from the dead but are there any new ways to do this? The two modules listed are no help...the first just wont install as I'm using processwire 3 (I get the error that dependencies are not met) and the second doesnt seem relevant at all? I just need to be able to set a date and publish on that date as OP said. Thanks Link to comment Share on other sites More sharing options...
teppo Posted July 25, 2019 Share Posted July 25, 2019 12 minutes ago, cleanboy3000 said: ...the first just wont install as I'm using processwire 3 (I get the error that dependencies are not met) Just checking: where / at what point of the installation process is this error coming up, and what does it say exactly? I'm currently testing this on a 3.x site and so far it seems to work. Note that if you're installing the module from the Modules section in the Admin, it will complain that the module hasn't been marked as compatible with 3.x. This alone doesn't mean that it won't work with 3.x, though it is good to be worried when you see a message like that ? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now