ImportPagesXml by justb3a

This ProcessWire module allows you to import and parse XML files (using xpath) to create or update pages.

WARNING: This repository is no longer maintained

This repository will not be updated. The repository will be kept available in read-only mode.

Import Pages From XML

This ProcessWire module allows you to import and parse XML files (using xpath) to create or update pages.

Screencast

Settings


After successfull installation go to Setup > Import Pages From XML to start using the XML Importer.

This module does not support all available field types. Nevertheless, I've refrained from restricting the supported field types because many of them should work by default.

Tested and working:

  • image including tag and description support
  • select
  • text
  • textarea
  • integer

The following field types will be ignored:

  • FieldsetTabOpen
  • FieldsetOpen
  • FieldsetClose

Not working:

  • file
  • repeater

Xpath Mappings


If you want to take advantage of references between fields in your xpath mapping then make sure the fields you're relating to are placed before the ones which need the relations. You can access and use any values/fields that you placed earlier in your file. Use $field_<fieldname> to match the desired value.

Example

<?xml version="1.0" encoding="UTF-8"?>

<songs>
    <song track="2">
        <title contact_id="1">Some song title</title>
    </song>
    <song track="7">
        <title contact_id="2">Just another song title</title>
    </song>
    <contact id="1" name="Sesmallbos" mail="info@test.org"/>
    <contact id="2" name="Sebigbos" mail="info@exam.ple"/>
</songs>
  • context: //song
  • field order: title, track, contact_id, contact_name, contact_mail
  • contact_id must be placed before contact_name and contact_mail
  • first get contact_id : title/@contact_id
  • then use that value as relation : //contact[@id="$field_artist_id"]/@name as well as //contact[@id="$field_artist_id"]/@mail

Further readings


Install and use modules at your own risk. Always have a site and database backup before installing new modules.

Twitter updates

  • This week we focus in on a new and unique Inputfield module added to the core that enables a lot of useful new input capabilities for tags, sortable multiple selection and custom user input— More
    30 April 2021
  • With more than 25 commits, ProcessWire 3.0.176 resolves lots of minor issues, adds support for multiple randomly selected read-only database connections, upgrades the tag features in the Template editor, adds a useful new Tags Inputfield, and more… More
    23 April 2021
  • This week ProcessWire (3.0.175) gained the ability to maintain separate read-only and read-write database connections to optimize scalability, cost and performance. The post covers why this can be so valuable and how to configure it in ProcessWire— More
    2 April 2021

Latest news

  • ProcessWire Weekly #364
    In the 364th issue of ProcessWire Weekly we'll introduce ProcessWire 3.0.177, check out a couple of new third party modules, and more. Read on!
    Weekly.pw / 1 May 2021
  • ProcessWire 3.0.177 core updates
    This week we focus in on a new and unique Inputfield module added to the core that enables a lot of useful new input capabilities for tags, sortable multiple selection and custom user input.
    Blog / 30 April 2021
  • 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