Jump to content

clsource

Members
  • Content Count

    346
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by clsource

  1. Thanks, but if you have a greater number of pages that need to be created, like 10K for example. The script would have O(n) execution times. I tried to use the command line, but for unknown reasons the same script only saved 1 person. There is a way to use javascript to programatically call a page with a chunk of people to save? Edit: I found something with jQuery Queue http://learn.jquery.com/effects/uses-of-queue-and-dequeue/ https://www.inkling.com/read/jquery-cookbook-cody-lindley-1st/chapter-17/recipe-17-5 I will look into it and post the results
  2. Hello, thanks for helping me. Currently I'm using a CSV with all the data. read the 2000 entrys and for each one create a new page // Csv Parsing $system = $pages->get('/system/people'); // 2000 people foreach($people as $friend) { $newFriend = new Page(); $newFriend->template = 'person'; $newFriend->parent = $system; $newFriend->name = md5($friend['name']); $newFriend->save(); $newFriend->title = $friend['name']; $newFriend->save(); }
  3. excelente trabajo, muchas gracias
  4. Hello, I'm trying to create some pages programatically, nearly 2000. they have many fields and the server crashes before complete saving them. There's a way to save this pages by small amounts? Thanks!
  5. Plase correct me if something is wrong, I'm still learning the processwire way xd. According to the API Docs http://processwire.com/api/variables/page/ $page->path The page's URL path from the homepage (i.e. /about/staff/ryan/) $page->url The page's URL path from the server's document root (may be the same as the $page->path) So I have to migrate a site from development to production server and all the links were messed up. Why? Because I was using $page->path for redirects. Changed redirects to $page->url and Presto! everything works fine. And, When to use $page->path? Use $page->path when importing other page. example $people = $pages->get('/system/people'); $friend = $pages->get($people->path . $input->urlSegment1); Use $page->url when you need a redirect $session->redirect($friend->url);
  6. So, I managed to make a complete migration. but something went wrong The development server was in root / and the production server was in a sub directory /pw All the links were mess up. So how I fixed it? Change all redirections inside my templates from using path to url $people = $pages->get('/system/people'); // Changed this $session->redirect($people->path); $session->redirect($people->url); made a backup of the site dumping the complete database. Copied and and pasted the files, changing the mysql connection in config.php. Still the links were Wrong. So I installed the site in Localhost, and using Export Module I managed to make a install profile. and success!, complete migration from develop server to production.
  7. Ok thank you guys are awesome.
  8. Thanks, that worked fine. but I must use a stripped down version of Processwire or else I would have clutter with templates, pages and fields that comes predefined.
  9. nevermind I found something here http://processwire.com/talk/topic/3113-how-to-transfer-processwire-from-local-installation-to-online/?hl=%2Bexport+%2Bsite#entry30649
  10. Hello, I'm using Processwire 2.4 and I need to export the profile for migrating. But the site is a little heavy and Export Module hangs in the middle creating corrupt files. How I can recreate what Export Module does? The Sql dump is generated, but not the complete install profile. Thanks
  11. And roles=<role name> ex: roles=admin if you need to only show certain users in a given role . Yep ProcessWire is that Awesome. And the people in the forums are the best
  12. I saved from admin (superuser), and using the APi. but @renobird solution was what i needed.
  13. Wow, thanks! I think that will do. But for curiosity, how we can have a selection of users inside a page field?
  14. Hello, I'm trying to create a template that have a field for storing what user modified it. So when editing a page I could have a Single Selection for users. I used a page field with a parent of Users. but when I try to save it says " Page 3234 is not valid for owner" Thanks for any help.
  15. I solved that problem by ssh into the server ssh <user>@<domain>.rhcloud.com and tar all files within app-root/repo/php tar all files from processwire after installation tar -zvcf pw.tar.gz . logout from ssh and cd into the local php directory and delete all files rm -rf . for x in `git status | grep deleted | awk '{print $3}'`; do git rm $x; done then download that tar inside the php directory wget http://<myapp>.rhcloud.com/pw.tar.gz and untar it tar -xvf pw.tar.gz finally commit changes git add . git commit -m "Processwire Setup" git push now you can develop
×
×
  • Create New...