Jump to content

Recently Updated Topics

Showing topics posted in for the last 7 days.

This stream auto-updates

  1. Today
  2. Hi everyone, For those of you running into compatibility issues with PHP 8 or needing a newer version of the underlying mPDF library, I wanted to let you know that I am working on a modernized successor to this module. To avoid clogging up this thread, I have started a separate discussion about the new project (currently named Wire2Pdf) here: If you are interested in a maintained version with PHP 8 support and new features, please join the conversation over there. Thanks!
  3. Hi everyone, Like many of you, I have relied on the Pages2Pdf module in the past. It was a great tool, but unfortunately, it seems to be no longer actively maintained. With the shift to PHP 8 in most modern environments, the older version of the underlying mPDF library used in the original module has become a bottleneck, causing compatibility issues. Since I needed a working solution for a current project, I have already created a fork and updated the code to work with a newer, PHP 8 compatible version of mPDF. The Idea: Wire2Pdf I am planning to release this updated version as a new module under the name Wire2Pdf. This would distinguish it from the legacy module and allow for new features (like custom font support) without breaking older installations. What I have done in a fork so far: Code refactoring for PHP 8 compatibility. Updated the mPDF library to a recent supported version. -> https://github.com/markusthomas/Pages2Pdf Before I proceed... I wanted to check with you first: Is there still a strong interest in a maintained module based on mPDF, or have you moved to other solutions (like RockPdf)? Are there specific pain points you had with Pages2Pdf that I should address if I move forward with Wire2Pdf? If there is enough interest, I will polish the code, package it as a new module, and release it. Cheers! Markus
      • 3
      • Like
  4. Good to know. Makes sense to keep it simple 🙂
  5. New version, added Stats & Page Structure Hierarchy. How to install: Create template (like lego.php) with name lego Create page /lego_1234/ with select template Open your path in browser lego.php
  6. Hi everyone! You’ve probably seen embedded product cards directly in articles on sites like Allegro? I was using Hanna Code but found its capabilities limiting for my needs, so I decided to fork it and create Embedr - a more feature-rich version: Key Features: 🎯 Dynamic content blocks via ProcessWire selectors (not just static code) 🔄 Live preview directly in admin interface 🎨 Built-in visual card builder (UIKit-based) - no PHP required! 📝 Custom PHP templates for full control when needed 🏷️ Reusable embed types system 🔍 Debug mode with comprehensive logging ✅ Guest-safe - works for all users out of the box Quick Example: Create an embed with a selector: Name: featured-products Selector: template=product, featured=1, limit=6 Type: products Insert in text: ((featured-products)) Done! The module automatically finds pages and renders product cards. Need custom design? Just create a PHP template at /site/templates/components/products.php GitHub: https://github.com/mxmsmnv/Embedr Give it a try and let me know what you think! 🚀
      • 3
      • Like
  7. Please try manually making changes to the module code in the relevant lines and, if possible, let us know whether it works or not.
  8. Yesterday
  9. @ryan, could you please take another look at this breaking change before releasing the next master: https://github.com/processwire/processwire-issues/issues/2157 I have modules that break when updating to the most recent PW version.
  10. Gemini replied the following after examining things a little bit: The Logic of Date Overlaps The reason your current selector fails is that it only checks if the existing booking completely "swallows" your new request. To catch any overlap (partial or full), you need to use the following logic: A booking overlaps if: The End of the existing booking is after the Start of the new request. AND the Start of the existing booking is before the End of the new request. The Correct ProcessWire Selector Assuming $id->datum is your new Start and $id->datumbis is your new End: // Define your requested range $newStart = $id->datum; $newEnd = $id->datumbis; // Find any page that overlaps // Logic: Existing End > Requested Start AND Existing Start < Requested End $overlap = $pages->find("template=booking, datumbis>$newStart, datum<$newEnd"); if($overlap->count > 0) { // Room is occupied echo "This room is already booked by " . $overlap->count . " existing reservation(s)."; } else { // Room is available echo "The room is available for this period!"; } Why this solves your problems: Existing Booking: 13.08.2025 to 04.12.2025 Problem 1 (01.07.2025 – 03.12.2025): * Is existing end (04.12) > new start (01.07)? Yes. Is existing start (13.08) < new end (03.12)? Yes. Result: Overlap detected. Problem 2 (01.10.2025 – 01.01.2026): Is existing end (04.12) > new start (01.10)? Yes. Is existing start (13.08) < new end (01.01)? Yes. Result: Overlap detected. Pro-Tip: Changeover Days If your system allows a guest to check in on the same day someone else checks out (e.g., Check-out at 11:00, Check-in at 15:00), use strictly "greater than" (>) and "less than" (<). If you use >= or <=, the system will flag the changeover day as a conflict. Using strict operators allows the dates to touch without overlapping. Data Types Ensure that $newStart and $newEnd are in the same format as stored in the database (usually Unix Timestamps or YYYY-MM-DD). If you are using ProcessWire's native Date fields, comparing them as Timestamps is the most reliable method.
  11. Last week
  12. Hi, sorry to be a bit late to answer this but those are two very different things when it comes to the wbr tag, it's pretty easy, in your site/modules/InputfieldCKEditor folder add a config js file which will allow you to solve both "problems", an exemple of one i have for an "old" website made with pw when it was using ckeditor 4 as its rich editor module CKEDITOR.editorConfig = function( config ) { CKEDITOR.config.fontSize_sizes = '8/.5rem;10/0.625rem;11/0.6875rem;12/0.75rem;14/0.875rem;16/1rem;18/1.125rem;20/1.25rem;22/1.375rem;24/1.5;28/1.75rem'; CKEDITOR.config.extraAllowedContent = 'section[id,class] wbr'; CKEDITOR.config.entities_additional = 'shy'; }; as you can see, i define some option for the font-size dropdown but here the thing we are interested in are the two other lines the extraAllowedContent tells cke not to delete those tags and allow section with id and class attribute and... the wbr tag (which, nomatter how you insert it will be transformed into <wbr /> but works the same way this being done, you can simply create a plugin to insert a wbr tag wherever you need when it comes to &shy; or its html equivalent &#173; its the config.entities_additional line that tells cke not to remove them, well actuelly only &shy; in my case, i don't need both... as you can see, as cke docs says no & nor ; in the list, i could have written 'shy,#173' to make it work for both entities now, the problem is... it works!!! but depending on your browser you may not see it when saving, even if you look at the field content directly in the ddb, it's not a ckeditor issue at all but just a browser behaviour easy to check saving your content/page and viewing it in the browser, using its responsive viewer tool, playing with the page width, you'll see the soft hyphen in action where you've inserted them 🙂 now, like for the wbr tag, you just have to create simple plugin to insert the sofh hyphen in both case, i prefer writing my plugins using icons in the toolbar rather than just keyboard shortcuts as this way i'm sure it will work whatever os my victims are on, pc, minux, mac, it will work when i'm not sure about keys numbers, i'm sure for enter, space but ten plugins later, i'm going to run out of shortcuts 😀 as simple as this 🙂 in case it helps (just tell me if you need help with this plugin thing) have a nice day Edited to add thnking it may be useful for those who keep using this good old CKEditor 4 in pw, i've added a github repo with the two plugins i'm speaking about https://github.com/virtualgadjo/pw-ckeditor4-plugins always in case it helps have a nice day
  13. @Frank Schneider Are you rendering this calendar on the front end or in the admin? First thing I noticed was that the closing </script> tag is missing. You can use the native PHP alternate control structure syntax if this is in a mixed markup/PHP file. It's up to your personal preference but it can help readability. <?php if ($page->path == "/avisierungen/kalender/" || $page->path == "/vermietungen/kalender/"): ?> <script> $(function(){ 'use strict' $('#calendar').fullCalendar({ header: { left: 'prev,next today', center: 'title', right: 'month,agendaWeek,agendaDay,listMonth' }, height: 'auto', contentHeight: 'auto', aspectRatio: 2.0, weekNumbers: true, navLinks: true, eventTextColor: 'black', defaultDate: '<?=date("Y-m-d")?>', editable: false, eventLimit: true, // allow "more" link when too many events events: <?=json_encode($calendar_data)?> }); }); </script> <?php endif ?>
  14. Thank you very much! It was really quite easy with ProcessAdminCustomPages and a foreach loop! $logentries = $log->getEntries("my-email-log", ["limit"=>"20"]); echo "<ul>"; foreach ($logentries as $logentry) { echo "<li>"; echo $logentry["user"]; echo " <br> "; echo $logentry["date"]; echo " <br> "; echo $logentry["url"]; echo " <br> "; echo $logentry["text"]; echo "</li>"; } echo "</ul>"; With chart.js, I was even able to implement a diagram.
  15. I don't know if this would be helpful to anyone but it saved me a lot of work so I thought I would share it. When using Duplicator on Windows (I don't think this is a problem on another platform), the installer.php script would always hang on unzipping the files and never make it to the uploading the database stage. No matter what I changed in terms of time out or memory allocation or anything, it still would never full extract everything, and what it did extract was VERY slow. What I ended up doing in replacing the code where it extracts the files with a native tar extract. Starting at the $zip = new ZipArchive(); text (about line 731), I replaced the code down to the closed brace (about line 750) with this: $zip = new ZipArchive(); $res = $zip->open($this->package); if ($res == true) { if (is_writable($path)){ // ---- START: system tar extraction (replacement) ---- $archive = escapeshellarg($this->package); $dest = escapeshellarg($path); // Laragon ships with bsdtar, which can extract zip files $cmd = "tar -xf $archive -C $dest"; exec($cmd, $output, $code); if ($code !== 0) { $this->err("An error occured while extracting the package."); return false; } } else { $zip->close(); $this->err("The temp folder $path is not writable. Please adjust the permissions and try again."); $this->btn("Check Again", 2, 'refresh', false, true); return false; } if ($zip) $zip->close(); $this->ok("The package has been extracted."); } else { $this->err("An error occured! Duplicator couldn't open {$this->package}."); } Once I did that, the extract took 10 seconds max for many hundreds of files, whereas before I would be waiting for many minutes only to have it abort. I did get the code from ChatGPT so if it doesn't look quite right, blame it, but it does work. 🙂 I know I could refactor this a bit to remove the $zip variables that aren't really doing anything now, but I didn't feel like redoing more parts of the script, and it doesn't hurt anything. I hope it helps someone. Maybe a real programmer could clean it up and put it in the options when generating the installer.php file?
  16. Hi everyone, I wanted to share a small utility module I’ve put together to help keep the /site/modules/ directory tidy. What it does: When updating modules ProcessWire renames old module directories by prepending a dot (e.g., .ModuleName). Over time, these "hidden" backup folders can clutter your file system. ProcessModuleCleaner identifies these orphaned directories and allows you to delete them directly from the admin interface. Key Features: Automatic Detection: Scans your site modules folder for any directory starting with a dot. Native UI: Built specifically for the ProcessWire backend using UIkit 3 classes for a seamless look. Interactive Selection: Uses AlpineJS for a fast and responsive "select all" and delete workflow. Safe Deletion: Uses ProcessWire's WireFileTools for reliable recursive directory removal. How to use: Install the module. Navigate to Setup > Module Cleaner. Review the list of found folders. Select the ones you want to remove and click "Delete". Screenshot / UI: The module displays a clean table with the folder name and the last modified date, so you know exactly how old those backups are. GitHub: https://github.com/markusthomas/ProcessModuleCleaner Module Directory: https://processwire.com/modules/process-module-cleaner/ I hope some of you find this helpful for keeping your production or development environments clean! Feedback is always welcome. Cheers!
      • 13
      • Like
      • Thanks
  17. On my Ubuntu (Gnome) laptop, I often get a popup saying an issue happened when waking up computer. I also sometimes had pain accessing an external drive, plug in, plug out, in, out... and finally it worked. Usually it works immediately, but not this time. Recently I was looking to free space, I have old accounts in my /home (from previous installations of Manjaro KDE, Manjaro Gnome...) and found I had 150 GB in the Download folder of one of this accounts. I opened a video just to check its content, and explorer crashed. I restarted explorer, selected everything in folder, deleted and... explorer crashed again. I tried again and this time it crashed when selecting files... I finally succeeded, but what a pain. I rarely turn off computer, just put it in sleep, I suppose this is why sometimes Firefox freezes for a few seconds after days without restarting, so I restart and everything is OK.
  18. Aurelien Barrau is a french physicist and philosopher, I translate: 😅
  19. Hi everybody, I'm trying to translate options into already activated languages, via hook: setOptionString works correctly for the default language, but I can't populate the options in other languages. More specifically, changing the user profile language the titles are translated, but the options are overwritten in the "default" language tab. So I have found the setOptionsStringLanguages method, but it seems to break someting (I have an error like: ProcessPageEdit:Multi language not enabled.. of course it's enabled) The scenario is a hook for an InputfieldSelect::render Any suggestion? Thanks in advance.
  20. It does but using MarkupCache means that the file doesn't exist on the filesystem so, to my original point, loading /sitemap.xml starts PHP, makes DB calls, and then returns the cached markup via a virtual URL. Yes, it's cached and faster than generating a new sitemap on demand, but not as fast or efficient as writing a file that has a direct URL on the filesystem. Your topic may be better suited for a separate thread about multisite implementations. This thread is for support and discussion of SeoMaestro.
  21. OK, got an answer. This $icsgen->events->add($myEvent); $icsgen->events->add($myEvent); does not work. This $icsgen->events->add([ 'summary' => $item->title, 'dtstart' => $item->Date_start, 'dtend' => $item->Date_end, ... ]); does. Why?...
  22. Hi @horst, here is the link to the discussion: https://github.com/FortAwesome/Font-Awesome/discussions/21364 Regards, Andreas
  23. Why does the locality & admin_area output in all caps? in the formatted output? Never mind, I found it, formats.php, thanks
  24. It turned out the generated RockMigrations code in the UI didn't use IDs, but it did get confused by me defining fields without prefixes in the UI. I found by deleting the duplicate fields that were not editable via the UI, and renaming the ones I wanted to use in a module to include the prefix, that seems to have got things working as expected. I just need to remember that the file name for the field/template for config migrations needs to be without the prefix, otherwise I'd end up with it double prefixed, and the problem would return. eg. Module called mymodule -> field name in UI = mymodule_myfield but file name with definition in mymodule/RockMigrations/fields needs to be just myfield.php The fields need to be renamed before they're added to a module migration. Template definitions in the migration need to use the full prefixed field names, as the template definition doesn't know or care whether the fields are included in the module migration or are in the site migration. After experimenting a bit more, I've found that having some fields/templates just in the site config migrations is a good compromise. It's better than using a site profile, as you can just copy and paste the fields and templates into an existing project even after initial setup. It's not quite as powerful as having the fields and templates in a module, as that provides dependency checking before installing a module that requires them to exist, but that's unlikely to be an issue in my own projects although it could be if I'm distributing modules that depend on certain fields existing.
  25. I know how to create pages with the API and how to add images and files. I just wondered, though, if there was any in-buit way to handle instant AJAX file uploads as the backend does. As you know, if you submit the files with the rest of the form it can take a while if there are multiple large files. In the PW CMS, however, you upload them and they're applied on save and somehow cleaned up if not used. Is there any way to tap into this workflow or do oyu have to roll your own? Thanks.
  1. Load more activity
×
×
  • Create New...