Juergen Posted January 23 Share Posted January 23 This is a reissue of a module of mine called "PublishingOptions", that I wrote a while ago. The big difference is that this module is written in PHP 8 and has some nice additional features. The old module could only publish and unpublish pages depending on date and time settings, but the new version goes much further. So you can decide what should happen after the publication end date has been reached. You have the following options: Unpublish the page - this is what the old version did Move the page to trash - new Delete the page permanently- new Move the page to a new position in the page tree - new The last option will be interesting if you want to move the page fe to an archive after a certain date. You can select the new parent page and after the publication end date has been reached, the page will be moved under the new parent page. You will find a more detailed instruction and download possibility at https://github.com/juergenweb/JkPublishPages This module is Alpha stage and should be tested carefully before using it on live sites. I have planned to add this module to the PW module download section, so everyone is invited to test it out and to report issues directly at GitHub. Thanx 11 1 Link to comment Share on other sites More sharing options...
Stefanowitsch Posted January 24 Share Posted January 24 Cool! I've been searching for a module like this. This comes in handy when users are preparing blog/news articles and want them to be published automatically on a specific date. I will definitely try it out. 2 Link to comment Share on other sites More sharing options...
Juergen Posted January 24 Author Share Posted January 24 Glad to hear that! 😀 Let me know, if you discover any issues. I will add this as soon as possible to the ProcessWire module directory, but as written, it needs to be tested first by several people. 1 Link to comment Share on other sites More sharing options...
Stefanowitsch Posted January 24 Share Posted January 24 I PHP 8.1 required? My projects run on PHP 8, because of several modules that do not work with 8.1 (yet!). Link to comment Share on other sites More sharing options...
Juergen Posted January 24 Author Share Posted January 24 No, it should work with 8.0, but not below. I have not checked it directly on my local server, but PHP-Storm does not complain after changing the version. I have changed the version on GitHub too, but you do not need to download it again. Please let me know, if something unexpected occurs, but I guess it will not.... BTW: In the module configuration settings set the CronJob interval to 1 minute for testing purposes, so you can check the functionality immediately. Later on, setting the value to 1 hour again, will be enough. Best regards 1 Link to comment Share on other sites More sharing options...
Juergen Posted January 24 Author Share Posted January 24 BTW: You will get also a notice that your system does not fulfill the requirements if you have not installed LazyCron (not only if the PHP version is lower). You can ignore this, because LazyCron will be installed automatically during the module installation, if it is not installed. Unfortunately, Processwire gives you a warning that your system does not fulfill the requirements for the module, but not exactly what the problem is. 😔 1 Link to comment Share on other sites More sharing options...
Stefanowitsch Posted February 7 Share Posted February 7 I have installed the module. On the module settings page in the "Add fields to template" checkbox-list some of my templates are missing (where I need to add the field). Does the module kind of "sort out" some templates depending on the settings here? Am I able to add the required fields "by hand" in the template settings instead? 1 Link to comment Share on other sites More sharing options...
Juergen Posted February 7 Author Share Posted February 7 Hello Stefanowitsch, you are right - this is exactly what it does. If you need a certain page to be selectable, you have to make some adjustments in the appropriate page template and sometimes in the template of the parent too. I recommend you to take a look at both template settings (current page template and parent page template) - in one or in both must be some restrictions set. If you need help, you can post a screenshots of both template settings here, and I will try to figure out the responsible setting. 1 hour ago, Stefanowitsch said: Am I able to add the required fields "by hand" in the template settings instead? This would not help you, because, apart from this module, ProcessWire does not let you choose and store a parent page, which will be not be allowed to be a parent page according to your template settings.😉 Link to comment Share on other sites More sharing options...
Stefanowitsch Posted February 7 Share Posted February 7 3 minutes ago, Juergen said: Hello Stefanowitsch, you are right - this is exactly what it does. If you need a certain page to be selectable, you have to make some adjustments in the appropriate page template and sometimes in the template of the parent too. I recommend you to take a look at both template settings (current page template and parent page template) - in one or in both must be some restrictions set. If you need help, you can post a screenshots of both template settings here, and I will try to figure out the responsible setting You are right. This setting here in the page template settings seems to be responsible for including/excluding the template in the module settings. This was set to "NO" in my case: May pages using this template have children? Is this critical for the module to work? I want to include the "Published From" field to a blog post template. This template should not be allowed to have subpages underneath it. 1 Link to comment Share on other sites More sharing options...
Juergen Posted February 7 Author Share Posted February 7 Sorry, @Stefanowitsch This was a missunderstanding. In your case every template should be visible. Link to comment Share on other sites More sharing options...
Juergen Posted February 7 Author Share Posted February 7 My explanation, was for the parent pages, not for adding the publishing fields to the template. To clearify: This blog post template will not be visible at the checkboxes list for the templates in your case? I will take a closer look on my local installation and give you a feed back after lunch. I guess there will be a problem in querying templates. 1 Link to comment Share on other sites More sharing options...
Stefanowitsch Posted February 7 Share Posted February 7 8 minutes ago, Juergen said: My explanation, was for the parent pages, not for adding the publishing fields to the template. To clearify: This blog post template will not be visible at the checkboxes list for the templates in your case? I will take a closer look on my local installation and give you a feed back after lunch. I guess there will be a problem in querying templates. I'll send you a PM with some screenshots of my page structure and the settings. 1 Link to comment Share on other sites More sharing options...
Juergen Posted February 7 Author Share Posted February 7 Hello @Stefanowitsch There was a wrong query string inside the method, which is responsible to find all frontend templates. I have corrected it on Github. You do not need to download and install the whole module. Please replace the file JkPublishPages.module from the module with the new one at Github and let me know, if it works now. I have bumped up the module version too, because this was a significant malfunction. BTW: you can set the child settings to no again and only to mention: the homepage is excluded from the templates. 1 Link to comment Share on other sites More sharing options...
Stefanowitsch Posted February 7 Share Posted February 7 Yes I can confirm now hat everything works as expected. 1 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