Jump to content

nbcommunication

Members
  • Posts

    307
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by nbcommunication

  1. Hi Ben, Glad to hear you got the account authorised ? Pop this before your call: $instagram = $modules->get("InstagramBasicDisplayApi"); Cheers, Chris
  2. Hello, With the API being deprecated at the end of this month, I've built a replacement module which uses the Instagram Basic Display API. Find out more here: Cheers, Chris
  3. Hi, The module is now ready for use in production. It is still in Beta as I need to test token renewal, but cannot do this yet due to how token renewal works. Cheers, Chris
  4. Hi @lpa, Apologies for the late response. I've had a look at this... Number 2 - width and height attributes not rendering - this isn't anything to do with PageimageSrcset. These options, when passed to Pageimage::render(), resize the image, but don't get rendered as attributes. If you want this behaviour, adding a markup option should do the trick: $content .= $img->render([ 'alt'=> $img->name, 'height' => $img->height, 'width' => $img->width, 'srcset' => '883, 687, 369', 'markup' => "<img src='{url}' alt='{alt}' width='{width}' height='{height}' />" ]); As for portrait mode, I'm not getting this when I test. I get: <img src='/site/assets/files/1033/placeholder-city.691x499.1000x667.webp' alt='placeholder-city.jpg' srcset=' /site/assets/files/1033/placeholder-city.369x266-srcset.webp 369w, /site/assets/files/1033/placeholder-city.687x496-srcset.webp 687w, /site/assets/files/1033/placeholder-city.691x499.webp 883w' > In your example, the image isn't being resized as portrait, so it is odd that the sizes attribute is being added. What settings do you have in the module config for Portrait mode? Are you on the latest version of the module (1.01)? Cheers, Chris
  5. Thanks @LAPS, have added that to my master copy and will add it to the repo soon.
  6. Hi @LAPS, Have a look at new() in WireMailTools. This is where the WireMail module is set either explicitly through a passed option or config setting, or inferred. Going by your first post, I think you may be able to set $config->wireMail, so it just uses default WireMail. Cheers, Chris
  7. @LAPS, @adrian - I only use WireMailgun and don't use ProMailer, so I'm not the best person to check with... However, as I understand it, any WireMail module installed supersedes the core WireMail functionality. For example, system error / forgot password emails we receive are sent through Mailgun. I've no idea how multiple WireMail modules are handled, but I assume that ProMailer gives you the option to choose which to use? Cheers, Chris
  8. Hi, this module is now in Beta. Still to add full documentation and Facebook App tips. Aiming to complete by the end of the week!
  9. Hi, I've updated this module with a lot of progress - still should be considered alpha, but should be ready for production soon. Cheers, Chris
  10. Hi @montero4, That all makes sense. You can also do the following: // Create an image variation 1200px wide with -srcset suffix $image = $page->image->width(1200, ["suffix" => "srcset"]); echo "<img src='$image->url' alt='$alt_text' srcset='$image->srcset'>"; // PageimageSrcset will use the original to generate the srcset value If you have a look at the Pageimage options, you can add a suffix to the filename when resizing. Cheers, Chris
  11. Hi @montero4, I'm sorry, I'm still not following? There's nothing stopping you changing the src - you should resize the image first: // Get the image $image = $page->images->first; // Resize the image $image = $image->size(1024, 468); // Output the image echo "<img src='$image->url' alt='$image->description' srcset='$image->srcset'>"; // Or alternatively echo $image->render(); PageimageSrcset recognises that it is an image variation and then uses the original to generate srcset variations. It isn't really this module's job to handle the src attribute. In theory you could do some manipulations of the "srcset" value to extract the first or last image for use, but I'd say it is a lot cleaner just to resize the image. Cheers, Chris
  12. For folk using the module - is the configuration of sets in the textarea working OK for you? I've been mulling over trying to build something a bit more user-friendly, like a kind of repeater field for entering data, but I'm not convinced that it would actually be easier to work with, particularly as I usually only enter an image width per line and that's it. In a future version I want to add the configuration on a per-field basis (maybe even per-image even though that would be overkill), so I want to get the configuration method as solid as possible first. Perhaps retaining the textarea, but with a live preview would be the best option? I'm also not sure whether it is useful to have portrait mode and UIkit widths as config options. Ultimately the module is meant to extend Pageimage so that srcset and sizes can be used - I feel these config options are a result of my own bias in how I use the module, and yet I don't think I've used the portrait option at all! Any ideas/thoughts you have, please come with them! Cheers, Chris
  13. Hi @adrian, Finally gotten a look - it was as I expected. When an email address is passed to WireMail::to() it is run through WireMail::sanitizeEmail(). This passes the email through both strtolower() and trim(). addRecipientVariables() was just using Sanitizer::email(), which doesn't pass the email through strtolower/trim, resulting in different keys. I've changed it to use sanitizeEmail(). Sorry it's taken so long to fix! Cheers, Chris
  14. Hi, With the deprecation of Instagram's API and therefore the end of the Instagram Feed module, I've developed a replacement module which uses the Instagram Basic Display API: https://github.com/nbcommunication/InstagramBasicDisplayApi To use this module you'll need: ProcessWire >= 2.7 A Facebook Developer account Access to the Instagram user account you wish to use Prior to installation, you'll need to create a Facebook app. The app you will create uses the User Token Generator for authentication - it does not need to be submitted for App Review (and therefore stays in Development mode). The README contains full instructions on how to create and set up the app and also how to use the module. The primary reason for this module's development was to retain functionality on existing websites that use the Instagram Feed module. To assist with upgrading, this module replicates some methods provided by Instagram Feed. I've already upgraded a couple of sites and it was quick and painless ? Cheers, Chris
  15. @teppo, having read a bit about <picture>, it probably would make sense to provide this functionality in the module, but possibly as a separate method distinct from render(). I’ve got a fair bit I want to do on this module, but it’s behind a lot of other work at the moment. I’ll add this to the todo list, but for the time being, I would go with writing something for your own use. Cheers, Chris
  16. Hi @montero4, Can you please give a code example? From your description, it seems to me that all you need to do is resize the pageimage before rendering/getting attributes. Cheers, Chris
  17. Hi @teppo, I've not used <picture> myself, so will need time to do a bit of research. Off the top of my head though, I do feel that this module wouldn't necessarily be the best place for it. When I get a chance I'll have a think through the implications. Cheers, Chris
  18. Hi @adrian, Apologies for the lack of response - been fairly in the thick of a project since being back to work after the new year. Hoping to get this looked at soon. Chris
  19. Hi @adrian, Yep, that'll do it - I'll pop strtolower() in place when assigning the key value to prevent that from happening. Cheers, Chris
  20. Hi, that could effect the count I think. I’m pretty sure it should be an associative array argument, so it would be $to[$emailAddress] = “”; (name omitted) I can’t actually see the implementation of the argument in WireMail::to() here - https://processwire.com/api/ref/wire-mail/to/ - on my mobile, but it should behave in the same way when using it with WireMailgun. Looking at the WireMail.php source I think maybe a sequential array is accepted - will need to look at this further!
  21. Hi @adrian, That's bizarre! I've just done a test using 200 test emails (string length > 998 [nearer 15000] so using folding for recipient variables) and it returned the correct number of emails sent. I don't think it is one for Mailgun support - the number/count generated is 1 if batch mode is off, and if it is on, as it is in this case, it returns the recipient variables count. If to() is set, it adds this to the recipient variables too, but because the recipient variables array is keyed by email, this shouldn't increase unless there are different emails in the to and recipient variables arrays. In other words, the count is internal; it's not returned by the Mailgun API. My first point of attack on the problem would be the Mailgun logs, followed by adding a few $this->log($data["recipient-variables"]); or $this->log(count(json_decode($data["recipient-variables"], 1))); calls in the module where appropriate to try and figure out where the problem is occurring. I don't actually have access to Mailgun logs here, so will get a better picture on Monday - perhaps sending in test mode is skewing my tests! Are you using this with ProMailer? Wondering whether the issue is integration with another module? Cheers, Chris
  22. HI @adrian - I've had a good look at it but can't find the issue running the code with some test data. Getting a 200 response and no errors logged. Are you able to see the "to" address in the Mailgun log for the request? If so, is there anything there that might indicate what is causing the "to" address to be invalid?
  23. Ah ok, I'll see what I can find ?
  24. Hi @adrian, was just about to test and noticed the extra $ on line 3&5 - I think it should be $u->email?
  25. Hi @adrian, will be back in the office on Friday so will take a look then. Happy New Year to all when it comes! Chris
×
×
  • Create New...