Jump to content

Jan Romero

Members
  • Posts

    612
  • Joined

  • Last visited

  • Days Won

    15

Everything posted by Jan Romero

  1. Sure, you can just put this in there: $m = new WireMail(); $m->to($email); $m->from('noreply@yoursite.cz'); $m->subject("Welcome to my cool website, {$user}!"); $m->body("Holá {$user}, welcome to the site."); $m->send(); Depending on the volume of sign ups you expect, you may want to do something more robust, though.
  2. Might be something to do with FormBuilder then. Is that how FormBuilder generates temporary page names or something? Unfortunately I don’t have FormBuilder, but if your license is still fresh you might want to run this by the FormBuilder support forum. The way your code looks, I suppose you don’t want FormBuilder to handle submitted requests at all, since you’re rolling everything yourself. So perhaps you want to use its “Submit to another URL” option.
  3. Mh, I dunno, looks fine to me, although you could eliminate one of the two save() calls and it’s unclear where the variables after the call to createUser() come from. I’m going to guess the problem is somewhere else. Have you confirmed that the POST data arrives and makes it through sanitation as expected? Are you using any other modules that may be involved in this process? Do the misbehaving fields have any validation or default value settings? Is “0.78273300-1590946171” the user’s title or its name or both? I see you’re not setting the title in your latest snippet, but if it’s just the title that shouldn’t interfere with the login.
  4. Are you not using the LoginRegister module anymore? I believe it has a feature that allows users to login with their email address. If you’re using the module, but you’re just doing your own registration, you might need to give the new user one or more roles for them to work with LoginRegister. In the module readme it says users are created with the “login-register” role. It’s curious that the page title is not what you explicitly set in the code you’ve shown. No idea why that happens. Since you’re creating a user, you should probably use $np = new User() instead of $np = new Page(), but I’m not sure if it makes any difference at that point.
  5. It’s both! A user is a special kind of page. If you look at ProcessWire’s source code, you will see that the User class extends the Page class. At first it’s a little confusing, but it’s pretty cool because you roughly always deal with the same (or quite similar) things in PW. For example, you can find users using selectors just like finding pages of content. You can also modify and save them the same way, as you did in your hook. And if you want to add a field to your user (maybe a profile picture) you know just what to do: create a field and add it to the template, just like any other content.
  6. Uh, I’ve never used LoginRegister, but some pointers: Not sure if you can use the hook arguments that way. I always use $event->arguments(0) (it’s a method). You should probably hook createUserReady instead. This fires immediately before the user is saved, so you don’t need to do it. You aren’t setting the user’s template to 57.
  7. I think this may be the problem. 58 seems to be the ID of your template, but the config setting must be supplied with the ID of the page. In your example from the opening post, that page is “Members”, so you want to change Members’ template to owners (58) and put Members’ ID into $config->usersPageIDs. It’s probably a four digit number rather than a double digit template ID.
  8. Hm, have you set the corresponding “allowed templates for children” and “allowed templates for parents” options in the templates’ family tabs?
  9. I would probably prefer to put my users under the Members page directly. That way you would still end up with your suggested page tree, but those pages would actually be the users and there would be no need to maintain a relationship between users and their pages. Have a look at this blog post for a tutorial: https://processwire.com/blog/posts/processwire-core-updates-2.5.14/#multiple-templates-or-parents-for-users
  10. WTF this actually works! I’ve also had this problem a couple of times since upgrading to ProcessWire 3. Somehow all kinds of Javascript stop working. I can see that mouseenter and mouseleave events are attached to the menu buttons, for example, but the events don’t seem to fire. There is nothing in the Firefox console to indicate an error. Pretty annoying stuff. I’ve just had a client report this to me as well and the best I could tell them was to try logging in through a private tab… As @Roberts R says, this should really be looked into. It’s a frustrating experience even for me just working on my own stuff, but clients are rendered completely helpless when it happens.
  11. I don’t see why it should, but fwiw I’m not running it. I’m a little lost here. Any more info on your setup and how you’re testing exactly? Perhaps someone else can chime in, I’m sure there are other ways of doing something like this. Likely more elegant ones too ? A less elegant way that comes to mind would be to do the check at the top of your 404 template, then change the status header to 200 render the page you want instead…
  12. Yup, it must be this one: https://processwire.com/blog/posts/pw-3.0.99/
  13. Sounds like a reasonable feature request. I’m assuming you’re using CKEditor? In the meantime, have you considered outputting directly from the image field? That is, looping through the images in your template and generating the markup that way. If you’re doing a gallery of all images on the page, or maybe all images with a certain tag, that seems like the way to go. It would also give you more control over the presentation, for example if you need clicked images to open in a lightbox or something.
  14. Mh, it works for me on PW 3.0.155. Although I noticed it needs a slash in front of the ? because of my template settings, so your specific example would not work in my setup.
  15. You could put this in your site/init.php: $this->addHookAfter("Page::viewable", function($event) { if ($event->object->isUnpublished() && wire('input')->get('preview') === 'true') { $event->return = true; } }); It won’t work in site/ready.php because the 404 will already be thrown by the time you get there. Of course, you may also make a module out of it.
  16. Okaydokes, I've opened an issue here https://github.com/processwire/processwire-issues/issues/1166
  17. Ah, I think the missing certificate is actually the reason Chrome refuses to load the images, because they’re coming from a different domain (www. vs. no www.). This happens in Firefox as well. If you use a relative address like you did in the sidebar, it should work. Edit: so the problem was in fact visible in your initial code snippet. My apologies ?
  18. Kind of doubt it’s a difference in how Chrome and the other browsers interpret the HTML ? It’s probably a CSS or JS thing. Have you been looking at the developer tools? Maybe there is something helpful in the javascript console. It’s going to be difficult to debug from afar. Is the site online anywhere?
  19. Done and also updated the price to “free”.
  20. There is a textformatter for this here: https://modules.processwire.com/modules/textformatter-srcset/ It’s somewhat old, but probably works fine.
  21. I love this update! I’m doing a non-english single-language site right now, so i’ll try it out asap ? Canonical URLs are also awesome! Finally I can get rid of the awkward concatenations ? Thanks Ryan!
  22. I think what you want is Jumplinks by Mike Rockett. It can be a little complex to set up. See the documentation here.
  23. I’m sure a hook specific to your site wouldn’t be a problem. A couple of questions you’ll need to ask yourself: Do you want to copy all body texts from the matrix field or just the first one? Should the markup CKEditor generates be included? Do you want changes made to the SEO Description field to sync back? Should the text be copied live as users are typing or just once when the page is saved? Is the SEO Description field locked or can it be edited by users? What should happen if a user changes both fields? The simplest way would probably be to hook Page::save in your ready.php, find the text and copy it over.
×
×
  • Create New...