A look at upcoming page export/import functions

ProcessWire 3.0.64

Last week I was out of town, and this week I came back to multiple client projects in progress. In one case, developing a login, authentication and download system for an existing ProcessWire powered site in Sweden. In another, developing a custom module for managing Facebook logins, pulling data from Facebook, and connecting them with ProcessWire accounts for a company in the Caribbean. And in yet another case, working on developing a rather complex website on a very short timeline, using Markup Regions for the first time on a client project (and thrilled how much they've simplified development). All of this is to say, I've been in ProcessWire the entire week, actually using it (my favorite tool) more than building it. Nevertheless, we've got a new core version for you, 3.0.64, which contains a few minor fixes and continues progress on our page import/export functions, which we'll talk a bit more about in this post.

A closer look at page export/import

I mentioned page export/import as one of the current projects in a post a few weeks back. A couple of weeks ago, the ProcessWire Weekly did a poll about what features you are most interested in. I noticed that the page export/import functions led the interest in the poll. I've also had a few people email me asking about it. So it's clear there's strong interest here, and it's probably the core project that deserves the most attention in the short term. I'm glad about that, because it's something I think I'll be using a lot too. Here's a little more about the plans.

The page export/import functions will be available both on the API side, and in the admin interface. It's already partially functional on the API side, which you'll see in the PagesExportImport class in the core. We've added a lot to that this week in ProcessWire 3.0.64. Though I don't suggest using it just yet, as there's still a lot of work left to do. But it may give you a few hints at what is yet to come:

  • You can export/import individual pages, or multiple pages from a PageArray.
  • The export/import format is based on JSON converted from PHP arrays.
  • The used JSON format supports any number of pages in a single JSON file.
  • The JSON format can also be used for copy/paste export and import processes, not unlike what we do with field/template exports and imports.
  • Exports that include file/image fields also save to ZIP files, so that the assets can be included.
  • The template, parent and other settings can be retained during import, or be modified.
  • When a page already exists, you can choose to have it be updated by the import, skip it, or create a new copy of it under a different name.

On the API side have the PagesExportImport class, and the plan is that once completed, we'll be providing methods in the $pages API variable for interacting with the export/import functions.

Export and import in the admin

While we will have some really useful API functions for export/import of pages, I imagine most will be using them via the admin interface instead. This part is not yet in development (we've got to finalize the API first), so this is just preliminary and may yet change.

At present, it looks like we'll be developing a Process module for the purpose, that lives at Pages > Export/Import. It will have both Export and Import tabs. From the Export tab, you'll be able to export specific pages, all children of a specific page, or some other group of pages filtered by InpufieldSelector.

On the Import tab, you'll be able to upload a file or paste in the export (JSON). You'll be able to instruct it to import to the locations specified in the export, or override the parent/template and potentially other settings during import.

We may also provide some other shortcuts to export/import. For instance, maybe we'll have buttons for that purpose on the settings tab of a Page. We'll also likely develop a ListerPro action module that provides a shortcut as well. In any case, the goal is to make the export/import process really convenient and easy to use.

Automation and feeds

I imagine the primary audience for these export/import functions will be web developers pulling and pushing updates between development and staging production sites. But it's worth noting that the API side of this will also be really handy for developing automated feeds for mirroring data between sites... something that I've done a lot of here in the past. Having the export/import functions built into the core API will really make this a lot simpler. I look forward to continuing development on this here and will continue to keep you up-to-date as progress is made. I'll likely have more to report on this next week as well.

Thanks for reading and hope that you all have a great weekend. Be sure to check in at the ProcessWire Weekly this weekend for the latest ProcessWire news and updates.

Comments

  • HMCB

    HMCB

    • 2 years ago
    • 60
    Welcome back Ryan and thanks. Looking forward to these new features.
  • Rainer Mertens

    Rainer Mertens

    • 2 years ago
    • 00
    This is so cool!
  • Alex Capes

    Alex Capes

    • 2 years ago
    • 10
    An extremely welcome feature, especially for pushing from staging > development. Thanks Ryan!
  • Jens Martsch

    Jens Martsch

    • 2 years ago
    • 00
    Wow. I waited so long for this

Post a comment

PrevBuilding the Canongate website with ProcessWire

4

Alex recently worked with design agency Human After All to build a website for this leading independent book publisher. This post discusses the highlights, challenges and successes in building this impressive ProcessWire-powered site. More 

NextProcessWire 3.0.65 core updates

8

This week’s core version on the dev branch includes a lot of small fixes and improvements. We’ve also got a new multi-language URL field available this week as well. More 

Twitter updates

  • New post: This week we take a look at what’s in ProcessWire 3.0.126 which focuses largely on resolving issue reports, but also includes a handy new Page if() method— More
    15 February 2019
  • New post: ProcessWire 3.0.125 has several useful new Sanitizer methods & options, plus new ways to access them directly from the Input API variable. This makes handling user input even easier than before. Plus updates to our i18n functions & API docs— More
    25 January 2019
  • New post: In this week’s post, we’ll take a look a look at the new website and focus on some parts of it and how they were built. Then we’ll dive into the latest version of ProcessWire on the dev branch, version 3.0.124— More
    11 January 2019

Latest news

  • ProcessWire Weekly #249
    In the 249th issue of ProcessWire Weekly we're going to walk you through the latest core updates (ProcessWire 3.0.126), introduce a new third party module called Page Access Releasetime, and pick a new site of the week. Read on!
    Weekly.pw / 16 February 2019
  • ProcessWire 3.0.126 core updates
    This week we take a look at what’s in ProcessWire 3.0.126 which focuses largely on resolving issue reports, but also includes a handy new $page->if() method. 
    Blog / 15 February 2019
  • Subscribe to weekly ProcessWire news

“I am currently managing a ProcessWire site with 2 million+ pages. It’s admirably fast, and much, much faster than any other CMS we tested.” —Nickie, Web developer