ProcessWire Weekly #130

The 130th issue of ProcessWire Weekly brings in all the latest news from the ProcessWire community. Modules, sites, and more. Read on!

Welcome to the latest issue of ProcessWire Weekly! It's been a busy week around here, and we're happy to share the latest news with our readers. While we don't have any new modules to share this time, there's plenty of other stuff going on.

This time we're taking a closer look at the latest development version of ProcessWire, 3.0.40. In other news we've got a list of recent forum posts and other online resources, a fresh recipe of the week, and of course we're introducing a brand new site of the week.

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: ProcessWire 3.0.40 and a bunch of tips and tricks

In his latest processwire.com blog post Ryan introduces our latest development version, 3.0.40, which has just been pushed to the dev branch at GitHub. This version contains mainly bug fixes, but also includes a few new features – or improvements to existing features – from recently submitted pull requests:

  • Code optimizations by pine3ree
  • New configuration option for image fields enables swapping the configured min/max dimensions for portrait images by LostKobrakai
  • New honeypot option for the comments field by iamwebrocker
  • Fix for a display issue in our "add page" screen by gmclelland

In addition to the development branch, our master branch has also been updated, and is now at version 3.0.39. All the features added to the master branch by this update have been described in detail in last three weekly blog posts, so remember to re-read those if you need a reminder.

The weekly blog post also includes a few neat tips and tricks for those who have been keeping up with the updates to the 3.0 branch: an alternative syntax for fallback fields, handy recipe for defining field-like fallback values for pages, and some additional tips and tricks for getting more out of the recently released functions API.

For more details about the core updates introduced here and some very cool tips and tricks, don't forget to check out Ryan's latest blog post at the processwire.com blog. Thanks!

Weekly forum highlights, tutorials, and other online resources

Here we've got a new collection of support forum highlights and other useful and/or interesting resources. As always please let us know if there's anything important we've missed so that we can include it in one of our future issues.

  • First of all we've got some pretty neat tricks for scheduling changes in a page's content, provided by Arjen and BitPoet. This is yet another example of how you can implement really powerful stuff with just a few fields and a touch of code.
  • Next up are two work-in-progress modules by Ben Byford – Subscribers and WireMailChimp. While the documentation is still a bit lacking, this is definitely something to keep an eye out for in terms of handling email lists.
  • The latest project to combine ProcessWire with modern PHP development and deployment tools is generator-jfdpw, a Yeoman Generator for setting up a new ProcessWire project. If you're into automating stuff, this is worth checking out.
  • Finally, an article posted to CMS Critic: How To Choose a CMS: a Simple Guide. The reason we're mentioning that article here is that while it was intended as an ad for another system, you can easily check all the "essential features" (and much more) with ProcesWire and some of our most popular modules. Just saying ;-)

If you're interested in ProcessWire news, discussions, and updates, there's always something going on at the support forum. Since we're only able to include a tiny selection of all that in our weekly updates, head down to the forum for more.

Recipe of the week: displaying a list of recently changed pages

This week's recipe was inspired by a recipe found from ProcessWire Recipes, but we ended up making it a bit more generic: instead of finding the most recently changed child of current page we're building a list of recently changed pages for the site.

The problem

You need to display a list of recently modified pages on the front-end of your site. Relatively typical need for sites where visitors are expected to visit relatively often: intranets, news portals, product lists, etc.

In this case we don't care about the type or scale of the change; if we did, this would require a bit more logic behind the scenes, a hook or two, and so on. In other words that would be a whole different recipe.

The solution

Since ProcessWire already keeps track of when pages were modified, this one is really simple to do. All we need to do is find a predefined number of pages, sorted by the modified date in descending order. The code for that looks like this:

<ul>
    <?php foreach ($pages->find("sort=-modified, limit=5") as $p): ?>
        <li><?= date("j.n.Y H:i", $p->modified) ?> – <?= $p->title ?></li>
    <?php endforeach; ?>
</ul>

Hidden or unpublished pages will be skipped by default, but your site could still have pages you don't want to include in such a list. In these cases you should limit this to specific types of pages by adding an additional template filter to the selector string: template=basic-page|blog-post|news-item.

If you've got a recipe of your own that you'd like to share with others, feel free to submit it at ProcessWire Recipes.

Stay tuned for our next issue

That's it for the 130th issue of ProcessWire Weekly. We'll be back with more news, updates, and content Saturday, 12th of November. 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!

Post a comment