justb3a Posted November 30, 2015 Share Posted November 30, 2015 This ProcessWire module allows you to import and parse XML files (using xpath) to create or update pages. [detailed instructions at github] 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. 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 14 Link to comment Share on other sites More sharing options...
louisstephens Posted February 1, 2016 Share Posted February 1, 2016 (edited) Has anyone used the import xml to pages module to create pages automatically? Ie, auto run every day or so to create new pages? Edited February 1, 2016 by kongondo merged your topic to the module's support thread Link to comment Share on other sites More sharing options...
cstevensjr Posted February 1, 2016 Share Posted February 1, 2016 You may want to check out this post https://processwire.com/talk/topic/9953-import-pagesfiles-from-xml-files/ Link to comment Share on other sites More sharing options...
kongondo Posted February 1, 2016 Share Posted February 1, 2016 <mod note> Hi @louisstephens, Please note that this forum (ProcessWire Support Forums → Community Support → Modules/Plugins) is a support board for existing modules only. If you your question is about module development, please use its sub-forum (ProcessWire Support Forums → Community Support → Modules/Plugins → Module/Plugin Development), If it's about a specific module and that module has its own support thread, please post your question in that thread (however long the thread might be (for now) - it will still be picked up). I am moving your thread to its appropriate forum. </mod note> Link to comment Share on other sites More sharing options...
iNoize Posted February 2, 2016 Share Posted February 2, 2016 Hi, seems nice worked also for me with simple XML files. Is it possible to fill also an adress in to an $map field ? I have fields like Name Street City and how to fill an $map->adress value ? Thanks Link to comment Share on other sites More sharing options...
justb3a Posted February 3, 2016 Author Share Posted February 3, 2016 @iNoize: Could you please provide an example? I'm not quite sure what you mean Link to comment Share on other sites More sharing options...
iNoize Posted February 3, 2016 Share Posted February 3, 2016 Sure , i try to import places from xml. is it possible to fill the $map->adress value with this module ? Tnx Link to comment Share on other sites More sharing options...
justb3a Posted February 23, 2016 Author Share Posted February 23, 2016 Sorry for the late reply, somehow I missed your answer. As I understand, you want to combine fields. This is not possible at the moment. How did you solve your request? If you need any hookable function, just let me know, I'll add it. Link to comment Share on other sites More sharing options...
iNoize Posted March 4, 2016 Share Posted March 4, 2016 Hi, thanks for your answer. I have no current solution. I need to fill the $map->address value. I will try to export my XML with combined data. Example Street postal code city in one value but how to fill only $map->address the $map variable has three values $map->lat $map->lng also Link to comment Share on other sites More sharing options...
hrjohn Posted April 8, 2016 Share Posted April 8, 2016 hi, first: thanks for your work. I've got a question to importing text withing cdata. If i map the title field from: <name><!--[CDATA[foo, bar - foobar]]--></name> i got the following error: You may not modify 'name' on page '/processwire/access/roles/guest/' because it is a system page Any idea to import the name field correctly? Link to comment Share on other sites More sharing options...
WinnieB Posted September 26, 2016 Share Posted September 26, 2016 I'm getting the following error trying to install module to PW 3.0.34. Do you think it's a version 3 compatibility issue or a configuration on my end? Thanks! Error: Call to undefined function Jos\Lib\wire() (line 34 of /Applications/MAMP/htdocs/pw3/site/modules/ImportPagesXml/lib/Parser.php) Link to comment Share on other sites More sharing options...
justb3a Posted September 28, 2016 Author Share Posted September 28, 2016 the master branch / version from pw module directory wasn't PW 3.x ready. Previously you had to use branch develop. But I just released a new version 1.0.0 which supports ProcessWire 3.x (only). Just update the module to the latest version and everything should work as expected. 4 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now