ProcessWire Weekly #127

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

Welcome to the 127th issue of ProcessWire Weekly. This week we're back with some of our regular topics: latest core updates, weekly forum highlights and online resources, recipe of the week, and 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!

Introducing ProcessWire 3.0.37 and a new ProField – ProFields Text Blocks

In his weekly blog post Ryan talks a bit about the latest version of ProcessWire, 3.0.37, and then moves on to introduce a brand new ProField module he's been working on: Text Blocks, the latest addition to the commercial ProFields module bundle.

ProcessWire 3.0.37

ProcessWire 3.0.37 is currently available via the dev branch, but should make it to the master branch next week. This focus in this release is in taking care of reported issues and merging pull requests – so yeah, no massive changes, mostly incremental stuff.

As a personal note, I'm quite happy to see that our GitHub repository is finally starting to grasp what we've all known for years: ProcessWire is not, and hasn't been for a long time, a one-man show. It's a group effort, and we're all part of it.

Whether by submitting code, issues, requests, or just by sharing ideas and opinions, every single member of our amazing community has helped make ProcessWire the system we all love. Keep up the great work, folks – it's very much appreciated!

ProFields Text Blocks

ProFields Text Blocks is a Textformatter module. It allows you to define reusable blocks of content via any textarea field on your site – including fields with CKEditor enabled –and then embed those blocks anywhere else on your site.

Text Blocks also enables editor-only comments and something called multi-value text blocks, but while we'd love to discuss these in detail here, we'll leave that part to Ryan. Suffice to say, the Text Blocks module can be very useful for some sites out there.

That's it for the core updates this week. Don't forget to check out Ryan's latest blog post for a very detailed introduction to the ProFields Text Blocks module. 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.

  • Our first resource comes from an eCommerce platform known as Snipcart. They've just published a blog post in which they talk in detail about integrating Snipcart with ProcessWire. There's some pretty good stuff in there.
  • If you're interested in local ProcessWire development, you probably should take a closer look at Laravel Valet – doubly so now that Rudy has posted an alternative ProcessWire driver for it. First one was posted by Benjamin Milde back in May.
  • Running a multisite installation, or perhaps interested in setting one up? You should check out the new development version of the Multisite module. This version will also play nicely together with ProcessWire 3.0.
  • The Protected Mode module by Adrian has received a major upgrade: thanks to contributions from Horst, the new version now provides improved support for temporary maintenance breaks!
  • Our last item for the week is the PagesSum module, which was originally posted at the support forum by ESRCH and has now been posted to GitHub by netcarver. It would've been a real shame if this little beauty got lost in an old forum thread!

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.

ProcessWire recipe of the week: use a different sets of template files based on the hostname

This week's recipe is a slightly edited version of the one authored and posted to the ProcessWire support forum by Raymond Geerts. In a nutshell this recipe provides you with an ability to serve different templates depending on which hostname was used.

If you're wondering why on earth would you ever want to do that, consider this: using this approach you could easily serve a mobile version of your site at m.domain.tld, or perhaps an AMP version at amp.domain.tld.

There are a lot of use cases where this could be useful, so let's give it a try, shall we?

The problem

You want to use a different location than site/templates when storing your template files – or use different sets of template files in parallel, based on a certain switch.

The solution

You are able to overrule this setting from the site/config.php as follows:

$config->urls->templates = $config->urls->site . 'mytemplates/';
$config->paths->templates = $config->paths->site . 'mytemplates/';

A trick you can use when developing on a live site is to duplicate the templates folder and rename the copy as templates-dev. Then point another domain (or subdomain) to the same hosting account, for an example dev.domain.ext for the development version and www.domain.ext for the live version.

With the following code you can access the development templates while normal visitors keep getting the default templates:

* Development example: Alias for template-dev access
if($_SERVER['HTTP_HOST'] == 'dev.domain.ext') {
    $config->urls->templates = $config->urls->site . 'templates-dev/';
    $config->paths->templates = $config->paths->site . 'templates-dev/';
    $config->debug = true;

You can make up all kind of 'rules'/conditions to go by when overruling the templates folder with php from the config.php file. For an example you can serve the same site with a different layout and code for mobile on m.domain.ext:

* Mobile example: Alias for template-mobile access
if($_SERVER['HTTP_HOST'] == 'm.domain.ext') {
    $config->urls->templates = $config->urls->site . 'templates-mobile/';
    $config->paths->templates = $config->paths->site . 'templates-mobile/';

... and that's it. As you can see, serving your site with a different set of template files is actually surprisingly simple – except that we are talking about ProcessWire here, and in this context a lot of things tend to be "surprisingly simple".

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. Also big thanks to Raymond for this week's recipe – thanks for sharing your knowledge with us!

Site of the week: Media Line

Our latest site of the week belongs to Media Line, a Swiss store for all sorts of audio and video equipment. Speakers, earphones, TV's, displays – you name it, they have it.

In addition to their two physical locations – the main store at Thun and a branch at Interlaken – Media Line also has an online store powered by the Padloper eCommerce platform. As a matter of fact this is a very good example of just how well a site and a shop can work together when they're literally built on top of the same system.

This site is the handiwork of novu GmbH and, much like their other projects, also has a very high-end look and feel to it. Content is nicely presented and there's a collection of stylish carousels and dynamically adaptable, Packery powered grids – all of which seem to fit the overall theme splendidly.

In addition to Packery, there are also traces of Fancybox, Flickity, noUiSlider, and Vue.js. Other mentionworthy features include a Mailchimp sign-up form and neat widget for Google Maps (and probably at least a few others we've completely missed).

Behind the scenes the site is powered by ProcessWire 2.7.2, and – as one would rightly expect from a site with built-in eCommerce features – all traffic is secured with HTTPS and an SSL certificate provided by the free certificate authority Let's Encrypt.

This is a great site and we're happy to have it in our sites directory. It's also good to see more sites trusting their eCommerce needs in the capable hands of Antti Peisa and his Padloper module. Congratulations to both the client and the team behind this project!

Stay tuned for our next issue

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

This post has 1 comment:

Adrian on Saturday 15th of October 2016 18:38 pm

Great edition as always Teppo - I think the recipe of the week section is really fanstastic!

Post a comment