ryan Posted June 16, 2017 Share Posted June 16, 2017 This week we take a closer look at the useful new page export/import functions that we’re currently building into the core: https://processwire.com/blog/posts/a-look-at-upcoming-page-export-import-functions/ 13 Link to comment Share on other sites More sharing options...
Robin S Posted June 16, 2017 Share Posted June 16, 2017 Quote In one case, developing a login, authentication and download system Quote developing a custom module for managing Facebook logins, pulling data from Facebook, and connecting them with ProcessWire accounts @ryan, stuff like this is super-interesting to us aspiring devs and I for one would give my right arm to take a peek at your code and see how an expert approaches these things. It would be a really great learning opportunity. In general, would your client contracts allow you to share snippets of project code with the community? Would you be comfortable doing that? (not expecting you to reveal all your secrets!) Not in any way that would require you to invest time in making things plug-and-play or offering support for them - just dropping some interesting bits as Gists on Github. A possibility? 8 Link to comment Share on other sites More sharing options...
ryan Posted June 18, 2017 Author Share Posted June 18, 2017 Quote In general, would your client contracts allow you to share snippets of project code with the community? Would you be comfortable doing that? (not expecting you to reveal all your secrets!) I actually think for this module the client expressed interest in us releasing it available for others to use once it's finished. I will confirm though. I used the process outlined on this page (link) to do a lot of it, though admittedly there was also a lot of stuff to figure out with some trial and error. 14 Link to comment Share on other sites More sharing options...
horst Posted July 21, 2017 Share Posted July 21, 2017 @ryan thanks a lot! I had a little use case where I couldn't resist to use the new feature. It was only for pages with text fieldtypes. I used two little bootstrap scripts to export & import some pages. export.php Spoiler <?php namespace ProcessWire; // export from site 1 include( __DIR__ . '/index.php'); $fn = 'd:/tmp/dump.txt'; $pa = $pages->find('template=hilfecontainer|hilfeeintrag|hilfeleerestemplate, include=all'); $pe = new PagesExportImport(); // ImExport Object $dump = serialize($pe->pagesToArray($pa)); file_put_contents($fn, $dump); // save serialized Pages Array import.php Spoiler <?php namespace ProcessWire; // import into site 2 include( __DIR__ . '/index.php'); $fn = 'd:/tmp/dump.txt'; $dump = file_get_contents($fn); $pa = unserialize($dump); // get back the Pages Array $pe = new PagesExportImport(); // ImExport Object $pe->arrayToPages($pa); // create the new Pages :) 13 Link to comment Share on other sites More sharing options...
kongondo Posted March 8, 2018 Share Posted March 8, 2018 On 7/21/2017 at 11:29 AM, horst said: I had a little use case where I couldn't resist to use the new feature. It was only for pages with text fieldtypes. I used two little bootstrap scripts to export & import some pages. Hi @horst. Why did you have to bootstrap ProcessWire? Were both sites not ProcessWire 3.x sites? Thanks. Link to comment Share on other sites More sharing options...
horst Posted March 8, 2018 Share Posted March 8, 2018 The only reason for bootstrapping in this usecase was, that I prefer this for administrative tasks. The pros are: cli access directly gives you superuser rights without extra login steps; it is very fast by copying the bootstrap script around in my local filesystem; It also works from more levels above the webroot; ... HTH to clarify. ? Link to comment Share on other sites More sharing options...
kongondo Posted March 8, 2018 Share Posted March 8, 2018 2 hours ago, horst said: The only reason for bootstrapping in this usecase was, that I prefer this for administrative tasks. The pros are: cli access directly gives you superuser rights without extra login steps; it is very fast by copying the bootstrap script around in my local filesystem; It also works from more levels above the webroot; ... HTH to clarify. ? Thanks. I'm a bit confused though. $pages should not work in a bootstrap context (you need wire('pages') or equivalent, so how come you are using that, or you'd defined $pages earlier? Link to comment Share on other sites More sharing options...
adrian Posted March 8, 2018 Share Posted March 8, 2018 4 hours ago, kongondo said: $pages should not work in a bootstrap context (you need wire('pages') or equivalent, Not anymore! Can't find where it was announced, but all pw variables have been available for quite some time now. 2 Link to comment Share on other sites More sharing options...
kongondo Posted March 8, 2018 Share Posted March 8, 2018 6 minutes ago, adrian said: Can't find where it was announced, but all pw variables have been available for quite some time now. Thanks. I feel like I'm light years behind! That's what happens when you are a late adopter! 1 Link to comment Share on other sites More sharing options...
horst Posted March 8, 2018 Share Posted March 8, 2018 Ha, I'm a late adaptor in so many parts. Feels really good to be one of the early birds in this special case. Link to comment Share on other sites More sharing options...
kongondo Posted March 22, 2018 Share Posted March 22, 2018 Just cross-referencing: I've ported the export functionality into a module and class for exporting ProcessWire 2.x sites in a format compatible with importing into ProcessWire 3.x using PagesExport/Import. 3 Link to comment Share on other sites More sharing options...
ocr_b Posted June 6, 2018 Share Posted June 6, 2018 Little question here: So the export exports fields and references to the files, which will then be downloaded via http by the import. Why did you decide not to export the template file of the selected page(s)? -- My first thought was: Cool, now I can develop a new template in a dev-enviroment, maybe also changing some other old pages, and deploy everything in one step to the production... Link to comment Share on other sites More sharing options...
kongondo Posted June 6, 2018 Share Posted June 6, 2018 3 hours ago, ocr_b said: Little question here: Is this question directed to me? Welcome to the forums. Link to comment Share on other sites More sharing options...
ocr_b Posted June 6, 2018 Share Posted June 6, 2018 2 hours ago, kongondo said: Welcome to the forums. Thanks, been around here for some time, but mainly reading ? 2 hours ago, kongondo said: Is this question directed to me? This question is directed to everybody working on the Page Export/Import Core Module. (And I could not find a better place to post this question, or should I open a new topic?) I just wondered if and why if its not including templates directly, although its including fields. Maybe there is a downside / use-case I do not see at the moment. Link to comment Share on other sites More sharing options...
jploch Posted June 11, 2022 Share Posted June 11, 2022 @ryan Do you have any plans to support the export/import of pages with a PageTable field? Would be nice ! ? Link to comment Share on other sites More sharing options...
jploch Posted June 15, 2022 Share Posted June 15, 2022 @ryan While working on my pagebuilder module I also figured out that the meta data from $page->meta() is not exported with the page. This is a real bummer, because my page builder is storing all the styling information in the corresponding $page->meta and it would be nice to use this core feature to export that data as well Link to comment Share on other sites More sharing options...
jploch Posted June 17, 2022 Share Posted June 17, 2022 I had a look at it and it wasn‘t that complicated to implement. I have now a version of the ProcessPagesExportImport module that support export/import of $page->meta(): https://github.com/jploch/ProcessPagesExportImport would be nice to have this in the core 2 2 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