Recently Browsing 0 members
No registered users viewing this page.
just 7 months ago, I was "just" a designer and a rather semi-developer, still struggling with WordPress sites and more often than not delegating that work to pros. ProcessWire really helped me realising that it's not that hard after all (well it's still hard but it's doable) and you learn a lot just by doing it which has to be true for all developers anyway. So I started coding myself, I might also have to thank the 2020 pandemic to help me focus a bit more than usual, I created a bunch of websites using PW already – one of which I can't wait to put on showcases but it's still not live yet. That is one big personal milestone for me. The next milestone would be to give something back, and so I'd like to take on contributing some code I wrote, namely a event calendar for anyone to use. It's my first attempt doing this so please don't eat me alive. It's not a PW module yet (that's the plan however) just a git but I'm positive it will be useful once it works – well it works but it still needs more work – because if I had found a module that came close I wouldn't have started coding it myself :D
With that, I will appreciate all input, be it how to improve the .js (probably especially), or the templates, or guidance how to proceed turning this into a PW-module, and of course, in that last process, no pun intended, suggestions to make it more versatile for different needs.
I'd like to set up a LazyCron function that fires every hour on each page that has a template named "post". So far I have gotten the function running. But when it has fired once on "Page with Title A", it takes and hour before it is fired again on any other pages. It makes sense, hooking the function with wire()->addHook().
What I want to do, is to get the function to be fired with LazyCron individually for each page. So that "Page with Title A" fires every hour (if it has pageviews), and "Page with Title B" is fired individually and possibly during the same timeline, if it has pageviews.
Is this possible? Or might there be another way to utilize a sort of LazyCron on individual pages?
LazyCron operates on an elapsed time interval, but you may want it to operate at specified times.
Assuming your website is going to be visited sufficiently frequently (either by real users or by a Cron job), you can do this by editing the file /assets/cache/LazyCron.cache. This file contains 21 timestamps – one for each of the LazyCron specified intervals (e.g. “everyMinute”). The timestamp denotes when that interval was last triggered. To make the trigger happen at the required time, change the timestamp in the matching row to be when the previous trigger should have occurred.
To make this easier, I have done an Excel spreadsheet (“Lazycron_fill.xlsx”) to simplify the process – just enter the required benchmark timings and copy the result into the LazyCron.cache file.
I am new to PW but already very convinced. I need to build a dropdown button to browse in a collection of authors by country and language. The dropdown should be editable in the BACK and displayed on the same as the authors collection. I tried my luck with "PageField Creator" but I don't know how to display the dropdown, I simply used:
"$content .=$page->Land;" (the name of the select field)
but nothing is displayed...
I see there is a 2nd module out there to achieve this : "Select Options Fieldtype". I am not sure what is the difference, anyone has a tip?
And a clear tutorial with the necessary steps to build this? I am a bit confused which should be the parent template or page, if it should have a file or not...
Thanks a lot in advance!