In the 354th issue of ProcessWire Weekly we're going to check out the latest core updates, properly introduce the ProcessCKInlineComplete module, and dig into a brand new site of the week. Read on!
Welcome to the latest issue of ProcessWire Weekly. In this issue we're going to cover the latest core updates and summarise a tutorial Ryan posted with his latest update via the support forum. Although the core version remains the same as last week, 3.0.172, there have still been some updates that we'll gladly share with you folks in a bit.
In other news we're finally going to take a closer look at the third party module known as ProcessCKInlineComplete (or Autocomplete for CKEditor), and in our site of the week section we'll highlight the portfolio of traveller and photographer Abe Kogan.
Thanks to all of our readers for being here with us again, and as always, any feedback is most welcome – please don't hesitate to drop us a line if there's anything in your mind you'd like to share with us. Enjoy our latest issue and have a great weekend!
Latest core updates
In his latest weekly update Ryan summarises the core development work he's done this week, and also digs a bit deeper into one particular topic: custom after-save actions in the Page editor. Here we'll talk a bit about the core updates, and then summarise what that latter part means in practice.
Quick rundown of core updates for the week
The core updates for the week — which you can check out from the weekly commit log — are as follows:
- Fix for a LazyCron bug introduced in 3.0.172. The module had ConfigurableModule interface unintentionally applied to it, resulting in errors in the admin panel.
- Support for "preload" modules, which are loaded before all other modules. This feature provides a solution to earlier request for a way to load Tracy Debugger before other modules.
- Documentation updates for the advanced mode configuration setting, detailing the features enabled by this switch.
- Core WireMail class and ProcessForgotPassword module were updated to look for default outbound (from) email address from config settings even if it was earlier cleared by a third party module.
Custom after-save actions in the Page editor
When we talk about after-save actions, what we mean are those handy little shortcuts you'll find from the page editor save button: "Save + Exit", "Save + Add New", and so on. One of the open requests in the processwire-requests repository was for the ability to define custom after save actions — which, as it happens, has since been implemented in the core, but not formally documented.
In his post Ryan provides us with a little tutorial for adding your own custom actions. We won't rephrase the whole tutorila here, but the gist of it is that you'll first want to hook into the ProcessPageEdit::getSubmitActions()
method to add your action to the button, and then hook to ProcessPageEdit::processSubmitAction()
in order to process your newly added action:
// add a new action called "hello"
$wire->addHookAfter('ProcessPageEdit::getSubmitActions', function($event) {
$actions = $event->return;
$actions['hello'] = [
'value' => 'hello',
'icon' => 'hand-spock-o',
'label' => '%s + Say Hello',
];
$event->return = $actions;
});
// process the "hello" action
$wire->addHookAfter('ProcessPageEdit::processSubmitAction', function($event) {
$action = $event->arguments(0);
$page = $process->getPage();
if ($action === 'hello') {
$notice = new NoticeWarning("Hello! You edited {$page->path}");
$notice->icon = 'hand-spock-o';
$event->notices->add($notice);
}
});
As you can see, it's actually pretty simple to add your own actions. The example above is not particularly useful, but you can find more useful examples from the weekly post, and you can perhaps think of a few of your examples own as well.
That's it for our core updates section this week. For more details, be sure to check out the weekly update from Ryan. Thanks!
New module: ProcessCKInlineComplete
Although not new as in something that was just released, ProcessCKInlineComplete is a third party module that we haven't yet had a chance to dig in properly. This module was developed by BitPoet and also goes by the name Autocomplete for CKEditor, and it was in fact briefly mentioned in our issue #225 way back in 2018.
In a nutshell ProcessCKInlineComplete adds an autocomplete search and simple dialog for embedding items within CKEditor field. These items can be pretty much anything: the module comes bundled with "actions" for embedding links to user pages or Hanna Code tags, but it's quite simple to extend the module with your own custom actions.
ProcessCKInlineComplete is tested with ProcessWire 3 and has been around for a while, but it's labeled "beta" and hasn't been added to our modules directory, so extra caution is recommended. That being said: be sure to give it a try if you come across a use case for an autocomplete embed feature.
Big thanks to BitPoet for sharing this module with us!
Site of the week: Split Seconds Gallery
Our latest site of the week is called Split Seconds Gallery, and it's a showcase of the photographic works of international entrepreneur, award-winning photographer and writer, world traveller, FIA Historic Formula One Class A champion racing driver, and film producer Abe Kogan.
The notion of ‘split seconds’ came about as Abe mulled over publishing a book featuring some of the images he had taken during a visit to Cuba. He mused that his camera’s shutter speed had averaged around 1⁄125 of a second for the hundred or so images. So the duration of all the action recorded in all 110 pictures added together was less than a second. Thus, a series of such books would indeed ‘Split Seconds’.
— Split Seconds Gallery
The Split Seconds Gallery website was built by Jolly Good Web Design, and is divided into one section about Abe's photographic journeys into Havana, Florence, and Hong Kong; second about his books; and third introducing the photographer himself. Design wise the site is clean and easy to grasp, and the photo galleries are of great quality — definitely a site to visit if you're even remotely into photography!
Regarding behind the scenes details, we've got a couple of observations to share: the front-end of this site appears to be built using the Foundation front-end framework, and behind the scenes we could spot the commercial ProCache module.
Thanks to the folks at Jolly Good Web Design for sharing this project with us, and our congratulations to Abe Kogan for his new website. The site looks great, and we quite enjoyed browsing through the photo galleries — great job from everyone involved!
Stay tuned for our next issue
That's all for the 354th issue of ProcessWire Weekly. We'll be back with more news, updates, and content Saturday, 27th of February. As always, ProcessWire newsletter subscribers will get our updates a few days later.
Thanks for staying with us, once again. Hope you've had a great and productive week, and don't forget to check out the ProcessWire forums for more interesting topics. Until next week, happy hacking with ProcessWire!
Robin S on Saturday 20th of February 2021 23:16 pm
Just a small clarification regarding the after-save action GitHub request... the post reads as if the request was made for something that was already supported in the core. But the request dates from March 2018 and requested feature was added in October 2019. I'm not sure if Ryan added the feature in response to the request and forgot to mention it in the GitHub request thread, or if he made the change of his own accord not knowing about the request.
teppo on Thursday 25th of February 2021 20:15 pm
Hey Robin — thanks, I've clarified the text above!