ProcessWire Weekly #450

In our 450th issue we'll check out the latest weekly update from Ryan, take an early sneak peek at a brand-new third party import module Import Tool, and more. Read on!

Welcome to the latest issue of ProcessWire Weekly, and merry Christmas! As it happens, our issues were perfectly timed this year: this issue is coming out precisely at Christmas Eve, while our last issue for the year is scheduled for the very last day of the year :)

In this issue we're going to take a closer look at the latest weekly update from Ryan, in which he among other things talks a bit about the schedule for our next stable release, and we'll also take a quick peek into a brand-new third party import module.

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!

Weekly update from Ryan

The main takeaway of the latest weekly update from Ryan, which was published via the support forum, is that there is going to be a new stable version of ProcessWire either at the end of this year, or alternatively very early next year. The state of the dev branch is very well aligned with this plan, as ample amount of time has already passed since any major — and potentially breaking — changes were last introduced.

There's not yet a hard deadline, so whether it's end of December or the 1st week of January, we'll have a new release out shortly. The dev branch is very stable right now (likely more stable than the master branch) so it's a good time to get a new version out.

— Ryan

As Ryan explains in his post, there are some bigger updates on their way — including JavaScript library version updates and the integration of the TinyMCE inputfield to the core — but they will of course be pushed to after a new release is out, since they will require more testing, which in turn would inevitably delay the release.

Hopefully we'll have more to tell about the new master release in next week's issue. In the meantime, if you haven't given the dev branch a try yet, feel free to do it now — as mentioned above it should be as stable (if not more stable) than the master branch by now. And if you do run into issues, let us know, preferably via the issues repository.

That's all for our core news for this week. For more details and the season's greetings, be sure to check out the weekly update from Ryan as well. Thanks!

New module: Import Tool

Import Tool is a brand-new third party module for ProcessWire. It is a new attempt to handle importing content from external sources — currently uploaded files — using a slightly different approach than some of the existing solutions, such as the Import Pages CSV module: preconfigured import profiles.

Though Import Tool provides a GUI (Admin page), that part is intentionally extremely simple. There are currently only two fields on that page; one for selecting the import profile, and another for uploading a .csv or .txt file to import content from. Everything else is configured via the import profile.

At the moment Import Tool is at a very early stage and import profiles are essentially just arrays defined via site config ($config->ImportTool). Here's an example of what a fully functional import profile might look like:

$config->ImportTools = [
    'profiles' => [
        'members' => [
            'label' => 'Members',
            'template' => 'member',
            'parent' => 1282,
            'values' => [
                'title' => [
                    'sanitize' => 'text',
                ],
                'first_name' => [
                    'sanitize' => 'text',
                ],
                'last_name' => [
                    'sanitize' => 'text',
                ],
                'date_of_birth' => [
                    'sanitize' => 'date',
                ],
                'email' => [
                    'sanitize' => 'email',
                ],
            ],
            'on_duplicate' => 'make_unique',
            'on_missing_page_ref' => 'create',
            'reader_settings' => [
                'delimiter' => ',',
                'enclosure' => '"',
            ]
        ],
    ],
];

Given following CSV file format, this would import each line using template "member" and parent page with ID 1282:

title,first_name,last_name,date_of_birth,gender,email
Helfand-Isa,Isa,Helfand,1999-03-21,1601,[email protected]
Raimondo-Sophia,Sophia,Raimondo,2009-11-04,1602,[email protected]
Ader-Rosene,Rosene,Ader,2000-11-02,1602,[email protected]

Additional (advanced) features are covered in Import Tool module's GitHub repository. One of these is support for callbacks. In addition to the "sanitize" property supporting custom callbacks, you can also provide a callback instead of a field name if you need more control over how the data is handled:

'start_time' => [
    'callback' => function($page, $field, $value, $args) {
        // time stored as separate column, but we want to combine it with date
        $page->start_date = implode(' ', array_filter([
            date('j.n.Y', $page->getUnformatted('start_date')),
            $value,
        ]));
    }
],

In case you're wondering why a tool like this makes sense given that we already have other tools for importing content, the main driver behind this module is to provide a very simple interface for end users, while giving developers full control over how the import is handled. Current state is the beginning, and there are plans for supporting new import file types, more programmatic actions during import, etc.

If you like this idea, feel free to give this module a try. You can grab the module's code from the Import Tool GitHub repository. Please note, though, that it is currently at an early beta stage — if you do install it, we must strongly recommend testing carefully before running it on a production site!

Site of the week: Barkawi

Our latest site of the week belongs to Barkawi, which is a German incubator and company builder with the mission to provide cutting-edge technology and superior services to increase the quality, efficiency and sustainability of global supply chains.

Founded in Munich in 1994, today Barkawi has around dozen of organizations around the globe. They have designed and implemented supply chain solutions for more than 500 clients (including large multinational companies) in over 100 countries, have 15 offices worldwide, and support both their our own start-ups and young supply chain entrepreneurs in establishing and building companies.

The ProcessWire powered website of Barkawi was created by typneun Designagentur, and is a multi-lingual (English and German) single page site. The design has a strong industrial look and feel to it, with clear-cut and easy to grasp layout, sharp typography, and well-thought-out visual elements and photography. The overall UX of this site feels intuitive and polished from start to finish.

As for behind the scenes details, there's not a whole lot to say: the front-end of this site appears to be hand-crafted, meaning that there is no full-blown front-end framework at play, and JavaScript dependencies have also been kept to the bare minimum. There is, though, a familiar third party module powering the forms of the site — the commercial Pro module Form Builder.

Big thanks to the folks at typneun Designagentur for sharing this project with us, and our congratulations to the client, Barkawi, for their new ProcessWire powered website. Great work from everyone involved in this project!

Stay tuned for our next issue

That's all for the 450th issue of ProcessWire Weekly. We'll be back with more news, updates, and content Saturday, 31st of December. 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