Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/07/2026 in all areas

  1. Until we get an "official" media manger module we need to make some workarounds. Let me tell you about my personal solution for this: I am using the FileMover module from @Robin S for copying images from a global "media library" field (that is placed inside a dedicated "media library" template ) to any of my image fields. Please have look at robins comment here where he extended the functionality of his module through a hook. In this case you can open the image library page through a modal with a click from any image field. There is also a small screencast that shows this – for me this is a really good workaround. Please have a look for yourself and give it a try (and some credits to robin!).
    2 points
  2. I spent a few hours this morning making an MCP module for ProcessWire similar to Laravel Boost. I'm going to call it Octopus. In just 2-3 hours with Opus 4.5, I'm already what feels like being done with 90% of it. I'm going to finish the remaining 90% (heh) as I work on various projects to actually test it. I will have to figure out the best way on how to provide ProcessWire documentation to the MCP (hence why I'm on this thread), but even without it, Opus 4.5 is insanely good in following ProcessWire conventions, even with little context! The hype is real. Let me know if you have any questions or suggestions. Screenshot attached.
    1 point
  3. As we close out 2025, I'm pleased to share a new module that I've been using in production: FieldtypeTimezone / InputfieldTimezone. 🎯 What It Does A straightforward timezone fieldtype that handles the complexity of timezones automatically - no configuration needed, just install and use. Key Features: Dynamic UTC offsets - automatically calculates current offsets with DST support Simple format - displays as "Country β†’ City (UTC+X)" Intelligent caching - 24-hour cache for optimal performance Production-ready - strict validation at all levels Complete coverage - all major world timezones included πŸ’‘ Why I Built This Working on global websites (wine shop, news portal), I needed a reliable way to handle user timezones without complexity. The module automatically adjusts UTC offsets for DST: America/New_York: UTC-5 in winter, UTC-4 in summer Europe/London: UTC+0 in winter, UTC+1 in summer πŸš€ Basic Usage <?php // Display date in a nice English format $timezone = $page->tz; // e.g., "America/New_York" if ($timezone) { $tz = new \DateTimeZone($timezone); $datetime = new \DateTime('now', $tz); echo $datetime->format('F j, Y \a\t g:i A T'); } ?> Perfect for: User profiles with timezone preferences Event calendars with automatic time conversion Global applications requiring accurate time display Any site serving users across multiple timezones πŸ“‹ Requirements ProcessWire 3.0.0+ PHP 8.1+ πŸ“¦ Installation GitHub: https://github.com/mxmsmnv/FieldtypeTimezone cd /path/to/processwire/site/modules/ git clone https://github.com/mxmsmnv/FieldtypeTimezone.git Or download and extract to /site/modules/FieldtypeTimezone/ Then install via Modules β†’ Site β†’ FieldtypeTimezone πŸ“– Documentation Full documentation with practical examples, API methods, and advanced usage scenarios is available in the GitHub repository. 🀝 Feedback Welcome The module has been tested in production on several sites, but I'd appreciate any feedback, suggestions, or bug reports from the community. Happy New Year to the ProcessWire community! πŸŽ‰
    1 point
  4. I have a website where the client can set different colors via input fields on a page in the backend. I want to make use of those colors as CSS vars to use them in my stylesheets. I am doing it this way: <style> :root { --primary-color: <?=$globalSettings->bg_colorcode?>; --secondary-color: <?=$globalSettings->font_colorcode?>; --tertiary-color: <?=$globalSettings->titlefont_colorcode?>; } </style> Then I can simply "grab" those variables in my stylesheets: header { background: var(--primary-color); } I am using UIKit and LESS and this is working for me.
    1 point
  5. 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
    1 point
  6. 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!
    1 point
  7. 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!
    1 point
  8. As I understand it, in order to save a comment you need to save the page the comments field is attached to, and given that you will need to save a comment in order to retrieve it's id for use as a parent_id in later calls you will be calling $page->save() multiple times for each post, but this won't require a "later loop for attaching the comment", you only need to iterate your posts once. you don't need an array to hold the comments , if that's what you mean, you use a reference to the comments field attached to the page $myPage->comments->addComment(Page $page, Field $field, Comment $comment, bool $send); you will need to create a new comment object to be passed in to the addComment() call.
    1 point
  9. Just for posteriority and show to readers how good the system run with a lot of pages. The system is going to be updated, and I just want to kept a trace of almost 7 years of service. The most important thing to me is: - not a single glitch since all this years - not a single update (excepting two core upgrade) Current grand total of pages: Selector: `$pages->count("status<" . Page::statusUnpublished . ", template!=admin")` Admin and frontpage load time: not really noticeable Result:
    1 point
  10. Here's a basic example of how you could save files to a PW page via a front-end page using tus-php and Uppy. 1. Install tus-php via Composer. 2. Create a PW template that will provide the tus-php server endpoint - in this example the template is named "uppy". In the template Files tab, disable any automatically appended template file. In the template URLs tab, allow URL segments. If using Tracy Debugger, disable the debug bar in the front-end for this template because we don't want any output from Tracy being included in the response. The contents of the uppy.php template file: <?php namespace ProcessWire; // Create PW temp directory $td = $files->tempDir('uppy'); $td_path = (string) $td; // Create TusPhp server $server = new \TusPhp\Tus\Server(); // Set path to endpoint - no trailing slash here $server->setApiPath('/uppy'); // Set upload directory $server->setUploadDir($td_path); // Listener function for when an upload is completed $server->event()->addListener('tus-server.upload.complete', function(\TusPhp\Events\TusEvent $event) { // Get path of uploaded file $file_path = $event->getFile()->getFilePath(); // Add uploaded file to "files" field on Home page $p = wire('pages')->get(1); $p->of(false); $p->files->add($file_path); $p->save('files'); }); // Send response $response = $server->serve(); $response->send(); // Exit from current PHP process // Could probably use PW halt here as an alternative // return $this->halt(); exit(0); 3. Create a page using the template - in this example the page is at url http://1testing.oo/uppy/ 4. Add the Uppy assets, JS and markup to the template of the front-end page that you will upload files from. Markup Regions are used in this example. <pw-region id="scripts"> <script src="https://transloadit.edgly.net/releases/uppy/v1.4.0/uppy.min.js"></script> <script> const uppy = Uppy.Core({debug: true, autoProceed: false}) .use(Uppy.Dashboard, {target: '#uppy-box', inline: true}) .use(Uppy.Tus, {endpoint: 'http://1testing.oo/uppy/', limit:10}); </script> </pw-region><!--#scripts--> <pw-region id="stylesheets"> <link href="https://transloadit.edgly.net/releases/uppy/v1.4.0/uppy.min.css" rel="stylesheet"> </pw-region><!--#stylesheets--> <div id="body"> <div id="uppy-box"></div> </div><!--#body--> 5. Upload files via the front-end and see that they are added to the "files" field on the Home page.
    1 point
Γ—
Γ—
  • Create New...