Jump to content

adrian

PW-Moderators
  • Posts

    10,902
  • Joined

  • Last visited

  • Days Won

    349

Everything posted by adrian

  1. Ok another update this morning - I have added support for full migration of page fields - it now automatically handles creation of the selectable pages fields, templates, and the pages themselves. The one thing I haven't really figured out how to tackle is what parent to put these pages under. At the moment they end up under the same parent page that you choose when starting an import. This is probably not ideal, but otherwise it could result in the need to create a whole other lot of parent parents/templates/fields that you don't really need on the destination PW site. This way everything needed gets migrated but nothing more and you can easily move them into a new parent (like a tools parent) if needed. Anyone have any better ideas? You might need to run a test to see what I mean. Again, this will probably need lots of testing so thanks in advance - there is a lot going on to make this all work!
  2. Raymond - this has been discussed, starting at this post: http://processwire.com/talk/topic/4650-new-processwire-admin-theme-on-dev-branch/?p=46259 Solution starts here: http://processwire.com/talk/topic/4650-new-processwire-admin-theme-on-dev-branch/?p=46380 and the next post.
  3. Hi Ollie, Without looking at your code in too much detail, the first obvious problems are the single equals signs in the if($item->parent = statements. Try using == and let us know if that fixes things. Also, you'll probably need to do $item->parent->name
  4. Well, now it's official - I've been outsmarted by a machine - if it can solve all Google reCAPTCHAs then it is one up on me. I am lucky to still have much better than 20/20 vision - I can't imagine how someone with failing eyesight manages with some of reCAPTCHA's concoctions! I hope this means that captchas will die a quick death!
  5. Ok, I have pushed another version to Github. v0.0.8 fixes the fieldsettab issue that Ozwim reported and introduces support for migrating repeater fields. It handles the creation of everything required on the source PW installation for the new repeater fields to work. Next on the roadmap is full support for page fields - currently only the page field itself is migrated, but not the selectable pages fields and templates. Then it is on to migrating the page content for repeater and page fields I would really appreciate any help testing out this new version. EDIT: Just updated the readme on github to detail what does and doesn't work, along with a rough roadmap - please let me know if your testing shows that I have any working/not working mistakes - I am sure there are some
  6. Hi Peter, This may not be an ideal approach, but you can save the page unpublished until the user actually clicks the save button. That way if they cancel/don't save, then it won't be published. You could also setup a lazycron to cleanup these canceled pages if need be.
  7. I can't seem to make myself use this on the regular basis, but reversing things so you have: if('group' == $page->template) This works well, because if you forget the second = you get an error, rather than php just setting the variable.
  8. I think you are looking for parent_id and template_id I make use of these in this module: https://github.com/adrianbj/ProcessPageFieldSelectCreator/blob/master/ProcessPageFieldSelectCreator.module#L377 To find these, just right click and inspect element - the id of the field without the "Inputfield_" is what you want to use. Hope that helps EDIT: You beat me to it
  9. Try this code somewhere in one of the files that are included on every page: if($config->debug && $this->user->isSuperuser()) include($config->paths->adminTemplates . "debug.inc");
  10. Ok, well I am still waiting to hear about the Pagefile::install hook issue , but in the meantime I have extended this module considerably. It now supports specifying multiple rules based on selected fields, templates, parent pages, and file extensions. This way you can infinitely configure the filename format exactly how you want. I'll add a post in the modules forum board once the hook issue is sorted, but for now, you can access the module at: https://github.com/adrianbj/CustomUploadNames I used Pete's work in the EmailToPage module as a starting point for the multiple rename rules in the module config. This mostly seems to be working really well, but unfortunately I can't seem to get ASM fields to initialize properly when adding another rule until it is saved and the page reloads. Any ideas? Attached is what the config settings looks like.
  11. That doesn't look complete - is that potentially a frame within another frame?
  12. It might help if you could post the HTML source of the this page (in an attached txt file) so we can see what divs are being produced to make this.
  13. Hi Pete, Just playing with this module for the first time - looks fantastic - thank you. Just a couple of things: there are lots of undefined variable and undefined index notices on the module config page that would be nice to have cleaned up. You still have "live" in the js file. I like the approach that Wanze took with live vs on in the batcher module depending on the version of jquery. Also, the "Add another category" button seems to be missing - I am guessing this is a class issue with Ryan's new default admin theme that I am testing it with. Thanks a lot for looking into these.
  14. That's not a valid selector. You could do: $pages->find("title=asd@asd.pl"); EDIT: Wanze beat me
  15. All you need to do is use a selector to see if the email already exists. Do this inside the if($input->post->submit) { and if it exists, do an: $email->error("Sorry, this email address is already in our system"); The selector can use something like: $email_exists = $pages->find(selector); if(count($email_exists) > 0){ to determine is the email address is already in the system.
  16. Not exactly sure if this is the same issue, but I have used this script (http://benalman.com/code/projects/php-simple-proxy/examples/simple/) in several cases and it works great. Here is a direct link to your web service output: http://benalman.com/code/projects/php-simple-proxy/ba-simple-proxy.php?url=http%3A%2F%2Fbenipeixcar.indinet.es%2Fservice-pages%2F%3Fparent%3D1013&full_headers=1&full_status=1 You should probably host the proxy file yourself though.
  17. Are you in the page tree - see attached screenshot EDIT: What interrobang said
  18. It's a little hard to follow exactly how you have your site structure, but you should be able to find the answer for your problem here: http://processwire.com/api/fieldtypes/images/ The very first example shows how to iterate through all images on a page: foreach($page->images as $image) { echo "<img src='$image->url'>"; } If you need to get the images from a child page then simply get the child page first using a selector: $childpage = $page->child(selector to get specific child); Then foreach through $childpage->images
  19. I have had this happen a couple of times before (although not for a long time, so I'd be curious what version of PW you are running). I would suggest removing the module you just tried to install - first the folder in the modules directory, and then the entry from the modules database table - fire up PHPMyAdmin to do this - hopefully your host has it or something similar.
  20. Hi Peter, I have done this, but it requires some core tweaks. Here is the relevant thread: http://processwire.com/talk/topic/2867-small-change-to-inputfieldfilejs-to-facilitate-front-end-html5-uploads/ I do agree though that it would be nice to make this easier.
  21. There are likely a couple of issues with your code. If your images field has "Maximum files allowed" set to anything but "1", you would need to do: $page->image_planet->first() because the images field is an array of more than one image. Also, you need to supply the src with the url to the image, so you would need: $page->image_planet->first()->url It's all in the cheatsheet: http://cheatsheet.processwire.com/ and the images documentation: http://processwire.com/api/fieldtypes/images/
  22. Hey Ryan, Thanks so much for the ability to access the Field object - that really helps. Unfortunately I still can't figure out the Pagefile::install hook. I am definitely trying to add a new file. I can't think of anything I am missing Can you see anything in my code that could be causing the problem? Thanks for any ideas.
  23. You need to define the page to get the children from. If you have that code in an rss.php file, then $page refers to that page. You need it to refer to the page that is the parent of the items you want to get, so try something like: $news_items = $pages->get(selector to get parent)->children(); PS Welcome to the forums
  24. If you want other date/time formats, check out the PHP manual: http://php.net/manual/en/function.date.php
  25. if I understand you correctly you just need to get the page(s) in question first, so something like: $pagestobetrashed = $pages->find("publish_until < time()"); foreach($pagestobetrashed as $ptbt){ $pages->trash($ptbt); }
×
×
  • Create New...