Jump to content

adrian

PW-Moderators
  • Posts

    11,097
  • Joined

  • Last visited

  • Days Won

    365

Everything posted by adrian

  1. Because you are using the blog module you need to configure the MigratorWordpress plugin (Modules > MigratorWordpress) to use the field/templates/pages that module uses. The defaults for the module don't match, which is why it has created new ones. If you take a look at what was created by the blog module, and replicate those - eg "blog-post", instead of the default "post" then everything should work as expected. Remember this is designed to work without the blog module being installed - perhaps the defaults should match those used by the blog module. Let me know how it goes after tweaking those settings. You may want to set up another clean site so you have a fresh starting point until you get those config settings correct.
  2. One more piece of advise - if the blog you are importing contains a lot of images, the import can take 10's of minutes, so be patient. I have also had some reports that in some cases the dev had to run the import twice to get everything to work - I haven't experienced this myself, but this is one of the reasons the module is not officially listed in the modules directory yet. As I get bug reports I am working to improve things, so please let me know your experience and any problems you have.
  3. Yep, that should do it. Take a look at the cheatsheet for learning about eq. You have three options for grabbing items from a PW array: ->first() ->last() ->eq(n) Typically with a slider you foreach through $page->images as $image, but it seems like you only have three images and you have distinct URL links for each one, so calling each one individually like you have might just be easier.
  4. Hi @kradzcalypse and welcome to the forums. Instead of: $page->image->Slide1 what you are looking for is: $page->image->eq(n) where "n" is the number of the image in the image field, starting at 0. Since you named it "image" and not "images" is it set up to handle more than one image?
  5. Try this: $authorID = $users->get($authorNameSanitiz)->id; You need to get the ID of the user, not the user object.
  6. Once the blog posts are imported, they will run just like other PW pages. The import itself is the only potentially tricky part. MigratorWordpress is configurable to match the names of the pages/templates/fields of kogondo's blog module, but if that isn't installed, then it will create all those pages/templates/fields itself. It will even import and create the users from the WP blog and assign the posts to the appropriate user. Once again, just test on a test PW site first so you learn all the options and make sure they are no conflicts / issues.
  7. Quick response: For changing the user of a page try: $p->created_users_id = $authorID; $p->save(array('quiet' => true)); If you also want to set the modified user you may need to use some SQL, although I think quiet save works for this also in newer dev versions of PW: $sql = "UPDATE `pages` SET `modified_users_id` = '".$authorID;."' WHERE `id` = '".$p->id."';"; $update = wire('db')->query($sql); Keep in mind that if you find you need to use the SQL approach, it will need to be executed after the last saving of the page or it will be overwritten.
  8. Tutorial in German, with videos: http://frankmaier.net/tutorials/processwire/ Migration to PW Article: http://www.jubatian.com/articles/migrating-to-processwire/
  9. Or do what I do - don't even both with the actual search functionality - just do a CTRL or CMD + F and type: ->of and let the browser find the text on the page.
  10. That's exactly what it is designed to do - if you import into a dedicated "blog" child page, all posts will be added to this tree without affecting anything else. I would caution you to do the import on a test PW installation first to make sure you understand all the import options and make sure there are no issues before doing on your actual dev site.
  11. https://github.com/NicoKnoll/MigratorWordpress I have used it successfully on two new sites and I know Septhiroth has also used it!
  12. @valan - thank you for helping to figure this out. I added your is_object check and also fixed the issue with the Delete tab not being hidden. Could you please try the new version and let me know if everything is working as expected?
  13. It is an alias for setOutputFormatting and it is directly under this one on cheatsheet http://cheatsheet.processwire.com/?filter=$page-%3Eof(true|false)
  14. Yep, 0,1,2,3 has nothing to do with the frame the image is taken from, they are just "names" for certain thumbnails. Here is a good thread detailing all the available images: http://stackoverflow.com/questions/2068344/how-do-i-get-a-youtube-video-thumbnail-from-the-youtube-api Actually on that note, I see that I am missing "sddefault", so I will add that now.
  15. Hi Peter, Glad you are liking the module. I haven't looked at this for a while, but at the time I built this it seemed like all the options were not always available with all videos which I why I built in the "First Available" option - that way you can list all, but only grab one. Would your needs be suited by reordering the list so that "default" was listed first? That way if it is available, it will grab that one, saving you the bandwidth of downloading the maxresdefault if you don't really need it.
  16. I am not sure what version of PW you were running before, but the current stable requires PHP version 5.3.8 or newer with PDO database support. That error is saying that you don't have PDO support. So you will need to correct that (your host should be able to deal with that for you), or you will need to revert to an older version of PW that worked with mysqli. Best of luck sorting it out.
  17. Sorry, I didn't read properly. I am still not exactly sure the scenario you have, but if I understand correctly, it is easy to get all the comments for a series of pages like this, without needing to hack core code: $selectedPages = $pages->find("id=4287|4304|4307|4314"); foreach($selectedPages as $p) { foreach($p->comments as $c) echo $c->text; } Maybe that isn't exactly what you need, but maybe it will be helpful. If not, can you explain a little more about how and where you want to output the comments.
  18. Try id instead of pages_id
  19. I assume this was directed at me, and not @arjen? I am trying to replicate your issue here but can't at the moment. Just quickly, I am wondering if that might be a bug in InputfieldWrapper.php Could you please try to replace that line 245: } if($this->getChildByName($item->attr('name')) && $item->parent) { with: } elseif($this->getChildByName($item->attr('name')) && $item->parent) { I am not sure this is the problem, but it's weird to me the styling Ryan has with the "if" starting on the same line as the closing curly brace, so I think it might be meant to be an "elseif". Anyway, let me know if that fixes things - if not can you narrow down a particular setup that results in the new error.
  20. I don't know what's going on with the extra output, but you have issues with your page saving. You should be doing: $nr->save() or $p->save(), not $page->save() I guess your first example will probably work as is, but the second one won't save the new page you have created - it will be save the current page that is being viewed, which is always $page.
  21. Simply add start=0 to the selector in your other queries.
  22. Would anyone else like to see the ability to make use of PW variables to build up dynamic descriptions and notes for fields? This is a very simplistic example and not that useful, but I do have some use cases where the ability to do something like this would be very handy: $f->description = __('Please make sure you fill out this field based on the content of the {page.parent.title} summary field.'); As I said - a bad example, but I think this could be a powerful addition in some scenarios.
  23. Keep in mind that the maintenance mode and protected mode modules only limit access to the front-end of the site, not the admin panel, so won't work for your needs anyway.
  24. Good point - I hadn't noticed this before as I guess I have never entered a relative URL in a FieldtypeURL field before. I guess the difference for me is that in an RTE field you always need to insert a URL, but in the case of a field that is just storing a link to a page, it might be better to store the page ID - I think if you do go this route, you want to store the ID, but always return the page object so in the template you could choose ->url, ->id, ->title, etc I think that looks much cleaner!
  25. I would suggest PM'ing Ryan about this.
×
×
  • Create New...