Jump to content


  • Posts

  • Joined

  • Last visited

Contact Methods

  • Website URL

Profile Information

  • Gender
  • Location

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

monollonom's Achievements

Full Member

Full Member (4/6)



  1. Hi, Thank you for your module. Just a suggestion : because I don't have a specific "description" field for the meta tag, I rely on an "about" field which is a CKEditor. Because of a <a> tag within it, there was an issue rendering one of the pages. So on my local copy I used $sanitizer->truncate() on line 134: $this->description = $this->description ?? $this->sanitizer->truncate($this->page->get($this->description_selector), 160, ['type' => 'sentence']); Maybe this could be a valuable addition ?
  2. Thank you for your detailed answer, I'll have a look and come back with the solution (or questions) I'll come up with !
  3. I just started using it on the client project I mentionned a while ago and it's working amazingly, thank you so much for your hard work ! I have one suggestion / request though: could there be a way to add a string at the end of the translation automatically ? Something like "(translated with DeepL)". Ideally as an option per text field ? I'm seeing from the source code that ___executeData() is hookable, would you suggest to go this way ? Editing the returned json ? Thank you in advance for your feedback / help.
  4. I thought my download link in the modules directory was working but apparently it didn't. Maybe because I forgot to create a release ? Anyway the download link should be working fine now.
  5. I made a small update where you can now output the QR Code on the front-end by calling the field directly (instead of rendering the inputfield) and I added the option to output the image in either .svg or .gif (if .svg, you'll have the additional ability to output the markup directly, instead of a base64).
  6. (once again I was surprised to see a work of mine pop up in the newsletter, this time without even listing the module on PW modules website 😅. Thx @teppo !) Github: https://github.com/romaincazier/FieldtypeQRCode Modules directory: https://processwire.com/modules/fieldtype-qrcode/ This is a simple module I made so a client could quickly grab a QR Code of the page's url in the admin. There's not much to it for now, but if need be you can output anything using a hook: $wire->addHookAfter("FieldtypeQRCode::getQRText", function($event) { $event->return = "Your custom text"; }) You can also output the QR code on your front-end by calling the field: echo $page->qr_code_field; The module uses the PHP library QR Code Generator by Kazuhiko Arase. When looking for a way to generate a QR Code in PW I came across @ryan's integration in his TFA module. I'm not very familiar with fieldtype/inputfield module development so I blindly followed @bernhard (great) tutorial and his BaseFieldtypeRuntime. At some point I'll take a deeper look to make a module on my own. Some ideas for improvements : add the ability to choose what to ouput : page's url / editUrl / file(s) / image(s) / ... allow to output multiple QR codes ?
  7. I'm on MacOS using Firefox. I know Firefox has its way of doing when it comes to some cases with margin-bottom... Regarding colors: maybe a suggestion would be to set the blue for buttons / nav bar to a be a bit more blue-ish. Here I took the color from the (invisible) background of thumbnails (32, 115, 206) : Edit: wouldn't mind as well to have the left and right paddings to match the ones on the header (40px left/right). And sorry for throwing you css details !
  8. Tiny detail but the margin-bottom on the footer creates a white space I was surprised at first seeing the new colors but it looks good !
  9. In the end it seems to work if I specifically save the Page Reference field: $home->save("events"); I'm still not sure though why saving the page from a guest session would break the link between images and their field...
  10. After some more testing, it looks like it's not because of the hook or the LazyCron but because of the code being executed by a guest. Edit: it's actually just the fact that I save the homepage (from a guest session) that makes the images disappear. I have access control toggled on for the homepage template but I thought API calls would be respected, am I wrong ?
  11. Yes at first I did set the output formatting to "false" but wanted to try and see how it goes without it, with no luck. I'll edit my post though, thanks. (also for completeness, I'll try again with of(false) just to be 100% sure)
  12. (I edited the title to reflect my findings down below, I'm leaving the original post as is though) Hi, This is the first time I'm using LazyCron so maybe I did something wrong but basically when the hook function is triggered and does its thing to the homepage, all images within that page disappear from the database, while remaining in the file system. When I try to re-upload the same image it tells me "Refused file X because it is already on the file system and owned by a different field" (couldn't find that other field though). Has anybody encountered something like this before ? Here is my hook, from ready.php: $wire->addHook("LazyCron::everyHour", function() { $home = wire("pages")->get(1); $home->of(false); $nextMonth = strtotime("next month"); $newEvents = wire("pages")->find("template=event, end_date>=today, start_date<$nextMonth, limit=10, sort=start_date, sort=end_date, sort=title"); foreach($home->events as $event) { if (!$newEvents->has($event)) { $home->events->remove($event); } } foreach($newEvents as $new) { if (!$home->events->has($new)) { $home->events->add($new); } } $home->save(); }); $home->events is a Page Reference field. The idea is to update the field with the ten closest events and allow the editor to sort them in the admin. Thank you !
  13. Hi Ryan, as part of your rewritting of the WireDatabasePDO class, did you get a chance to have a look at this issue ?
  14. I've never worked with custom page classes but I assume you could add a hook on the "loaded" event of your custom page and execute your custom function, something like : $wire->addHookAfter("CustomPage::loaded", function($event) { $page = $event->object; $page->yourCustomPageFunction(); });
  15. Have you tried with Pages::added ?
  • Create New...