Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/06/2026 in all areas

  1. This week on the dev branch we've got several commits with various core improvements and fixes. @adrian has been using Claude Code to suggest core optimizations (focused mostly on the PageFinder) and so he sent the suggestions to me. (PageFinder is the brains behind the $pages->find() method, and many others). I took the suggestions and coded them into our PageFinder, but didn't want to mess with what was already working well, so put them in a new class named PageFinder2, at least temporarily. If running the latest dev branch, you can enable PageFinder2 by adding the following to your /site/config.php: $config->PageFinder('version', 2); The most significant changes are: using subqueries for subselectors rather than separate independent queries; Reusing PageFinder instances (keeping a pool of typically 1-3 PageFinders rather than creating a new one for each $pages->find() operation); and lots of in_array() calls have been converted to isset() lookups, which should technically be faster (still the case in PHP8?, I'm not sure). There were some other changes as well. Theoretically these changes should make PageFinder even faster than it already is. I did quite a bit of testing and found that for the most part it performs the same as PageFinder v1. But then I came across a rather complex selector that translated to a much faster PageFinder operation, nearly twice as fast, and that convinced me it was worthwhile. While PageFinder v2 is not consistently faster than v1, there are some situations where it can be a lot faster. I'm not totally clear on what those situations are just yet, but I'll be doing more testing. In other situations it also can use a lot fewer queries, though that doesn't necessarily translate to a performance difference. But on the whole, all of Claude's suggestions were quite good, regardless of performance improvements. I was pretty impressed with what Claude Code had suggested, so decided to install it on my computer too. I've found it's particularly good at finding bugs. I'll ask it to do a code review on a core file, and it always has good suggestions. It uses ProcessWire terminology too. For instance it pointed me to an object that wasn't properly "wired to the ProcessWire instance", and that's something you'd only ever hear in ProcessWire land. Claude code also helped with improvements to our DatabaseQuery* classes, PagesVersions module, Wire base class, NullPage class, and minor updates to the PagesLoader* classes. I'm not having it write any code just yet, but am having it suggest where improvements can be made. I like to code. I asked it how it knew so much about ProcessWire, and it said that it stays up-to-date with the forums, the website, API docs, and GitHub repo. Thanks to @adrian and @Jan V. for recommending it to me (Jan V. uses it to manage this webserver), I can see how it's going to be a big help to ProcessWire with its suggestions and ideas, I'm already learning a lot from it. And if you get a chance to try the updated PageFinder, please let me know how it works for you. Thanks for reading and have a great weekend!
    4 points
  2. Thanks for the links @AndZyk! I'll have to read through them to see if this does what I want. I was able to change the actual classes that are applied by the dropdown, but then it obviously did not show up in the editor, so that is the part I'm hoping to find an answer for.
    1 point
  3. Hey, I've started to create a Media Hub for Processwire. [Edit...newest updates to UI are in later posts] Screenshots attached. Obviously a few UI improvements are needed 🙂 One of my clients requested a centralised media manager. I thought it'd be fun to give it a go and learn some stuff. I know that with a self-built Module, it'll always be maintained, and I have an active interest in evolving it. Shout out to @markus-th who just announced he is doing similar with WireMedia.
    1 point
  4. Hi everyone, I’m currently working on a module called WireMedia Library and wanted to share the current state of development to get some feedback on the concept. The main goal is to provide a central interface for managing media across the entire ProcessWire instance while staying 100% compatible with the native storage system. The Concept: The module acts as a central hub. You can upload files to the library and then select them from any page. When a file is selected, it is copied into the local page’s file/image field. This ensures that the files remain "native" to the page they are used on, keeping your API calls and templates exactly as they are. Key Features of the current prototype: Central Media Overview: A unified view of all media assets in the system. Usage Tracking: The module indexes where files are used. Even if a file is used within a Repeater, it identifies the "leading" parent page so you know exactly where your assets live. Database Indexing: A custom database table keeps track of file locations for fast performance. Rebuild Index: A tool to rescan the system and ensure the database stays in sync with the file system. Native Workflow: Since files are copied to local fields, you can still use all native PW features (like cropping or focus points) directly on the target page. Planned: Permission System: Granular access control for different user roles/folders. I am still undecided about the final licensing or if/how I will release the module, but I wanted to show the UI and the logic behind it to see if this approach resonates with the community. I’d love to hear your thoughts on the "copy-to-field" approach and the general UI!
    1 point
  5. Looks great. New to PW here and have been scanning the forums for best practices on including images on static pages (no image fields). A media library seems to be the way... I wanted to understand how I might use the PageImageSource module to render webp srcsets on the fly for static images but was disappointed to learn that it can only be used with PageImage images. https://github.com/nbcommunication/PageimageSource I think ProcessWire would be a hard sell to many clients without some a full-featured image library solution, which is a great pity. The UI looks well done.
    1 point
  6. Is "race" the only template that can be used for children of your page? If so you could instead use the name format to skip the Page Add step
    1 point
  7. Hi, maybe another hook event in site/ready.php works better. Make the title and name field not mandatory if needed an hide them from the user input via the PW backend page/template settings. // Note: Uses PW Function-API for sanitizer() call inside the function. You may need to enable this feature in yur PW config to work. $wire->addHookAfter('Pages::saveReady(template=your-template)', function (HookEvent $event) { // Ensure we have a valid event page. $page = $event->arguments(0); if (!$page || $page->isTrash) return; // Set a default title for newly created pages not yet saved, just created and shown in the PW admin backend. if ($page->id == 0) { $page->title = sanitizer()->name('your-unique-timestamp'); // or whatever sanitizer fits your needs. return; } // Check if there already exists a page with the same 'unique-timestamp' for actual page to be saved if needed. // If that could ever happen, you may want show a message and skip actual page from beeing saved. $tsPageAlreadyExists = false; // add whatever test will fit your needs if ($tsPageAlreadyExists) { $page->error("Page timestamp already exists."); $event->replace = true; return; } // If we end up here, we can save the page with a unique timestamp. $page->title = sanitizer()->name('your-unique-timestamp'); // or whatever sanitizer fits your needs. $page->name = sanitizer()->pageName('your-unique-timestamp'); }); P.S.: Written on an iPad out of my head, so it may our may not work 🙂 Cheers
    1 point
  8. Media Hub update. Just a few small ones. You can rename the asset filename. If you select a folder or Collection, you can upload media / images directly into that I have started using Media Hub in one of my own live sites and it's highlghted some great areas for improvement etc. There's a significant difference between uploading a few Instagram photos and real staff photos, logos, and branding assets, which need to reside in multiple places across the site, yet remain a single image in the back-end. So, thats where I am. Hoping to ask for a few beta testers soon. If you're interested, please PM me.
    1 point
  9. Not that long ago I started with a completely new approach in regards to ProcessWire an AI. I had some rules, commands, and settings for Windsurf and Cursor months back but nothing really worked as good as I hoped it would and lost interest. Even switched to Astro, NextJS, BHVR, and other JS solutions. 🙈 ProcessWire-based development went back to 80% hand-coded with some assistance on the sidelines, mostly debugging, security, and tasks that were more PHP-focussed than ProcessWire-related. Then AGENTS.md and SKILLS came up. Custom instructions, guardrails, links to docs and example code. Almost similar to a README.md but for AI coding tools. The main problem still was the knowledge gap in models. They just didn't know enough about ProcessWire works and how to do more complex stuff. With SKILLS this changed. I pulled the entire docs, some blog posts, took some of the old recipes and let the AI do its magic. The AI repackaged the entire docs, custom instructions, module docs, PHP best practices, and everything else into skills. I installed new and clean instances of ProcessWire and just asked the AI to build things. Yeah... didn't work as expected. I gave the AI more tools to work with and fixed the AGENTS.md: RockMigrations - for creating and updating templates, fields, and pages 🥰 AutoTemplateStubs - for details about existing templates and fields 🤯 ProcessDatabaseBackups - can be a good idea to give your tools a database file it can look into without the need to bootstrap ProcessWire into a custom script or similar. Inline comments in config.php to mark things as important or noteworthy otherwise that file would be ignored /init - a custom action OpenCode, Claude Code, and some other tools have to initialize the whole project 💯 Now my tools have all the skills and know how to use RockMigrations to create templates, fields, and pages, can trigger database backups and look into the made changes, know how to build a custom module. Even custom page classes or URL hooks aren't a problem anymore. The AGENTS.md contains now critical changes in the config.php, has links to all the skills, and whatever necessary. The /init command is very capable of creating it nowadays. I just started to test it more and more. With fresh installations, older projects and even recent projects that have tons of everything. Whenever problems occure I let the AI update the skills or create new ones that take care of the problems it faced. Learning by mistakes. The overall workflow A README.md with a scope of the project, necessary templates and their fields, overall main features besides handling page rendering, like a bookmarking function for recipes or read articles, newsletter signups, automation tasks to clean up older data, and whatever the project needs. The amount of typing is still the same but now mainly in markdown files that explain what to build (/specs), what to fix (/issues), and what we have done already (/docs). I always start in PLAN mode. Starting simple with the overall idea, goals, and outcome. Then the combination of tool and model is important. OpenCode and Claude Code are great at thinking and planning but they need a capable model like Opus, Kimi K2.5 Thinking or even GLM-5. They start to ask questions, give options, recommend workflows. When that's done i ask to save everything to a file in the /specs folder. From here I can either switch to BUILD mode, manually tweaks the plan file, or let other models (Gemini 3 Pro or Codex) review it and ask for suggestions, changes, fixes. Github: https://github.com/webmanufaktur/pwaiworkflow/ Installation: Download and extract files Move entire .agents folder into the project root next to the wire/ folder Look into create-symlinks.sh, run if necessary --- Plans Windsurf $10/month (Legacy) with access to all Anthropic, OpenAI, Google models, and many more Z.AI Coding Plan Pro $120/year (BlackFriday Deal) with all GLM models, including GLM-5 and future releases Kimi Moderato $19/month with Kimi K2.5 (just expired) Minimax Coding Plan $20/month with M2.5 (started using it as successor to Kimi) Tools OpenCode - https://opencode.ai/ Similar to Claude Code, easy to configure, and even easier to extend with custom modes, agents, skills, and whatever you might need or want. Has a great planning mode and doesn't ask unnecessary questions in the middle of tasks like Claude Code did for a while just to burn more tokens. Kimi Code CLI (with Kimi K2.5) - https://www.kimi.com/code/en Tested it last month and while it's a CLI like OpenCode/Claude Code it feels and works totally different. It doesn't have any modes but supports AGENTS.md and SKILLS. Super fast and it is super capable for quick fixes, smaller features, or heavy automations. Windsurf IDE - https://windsurf.com/editor Like Cursor with almost identical features, a custom terminal integration, includes a browser that has full access and control which is great for debugging, UI/UX (especially with Opus 4x.) - I guess most of you have seen in the past or even tried it. Was called Codium before and I know some of you used that Codium Extension which was awesome.
    1 point
  10. Some more work. Not sure why the images are so fuzzy Image detail page You can edit the usual stuff...Title, Alt, Description, and add Tags etc Some utilities in there too such as Download, Copy URl, Duplicate, Delete If an image has Crop versions they are displayed under the main image Crop versions has thumbs and table view A crop version has a detailed view too Image Crop page There are presets, but you can create your own named crops Save as a crop version or save as a new image. The hardest part is in progress which is A custom Inputfield which allows you to add images from the MediaHub. All while maintaining a connection back to the hub source file. IE it's important that there's no duplication and that the images in the Media Hub are a true source / canonical version Displaying images in the page edit field in a nice consistent way with the existing UI. As much as possible, I want the user to feel like this the core and not some bolt-on with its own CSS. Although I am changing some things… Hope you like! P
    1 point
  11. This looks great! Any chance you could share a bit more detail on how file storage and file usage in page templates will work? Also wondering if there’ll be a custom field type replacing / extending the core image/file fields.
    1 point
  12. Hey everyone, I have some updates to MediaHub to share. Media Hub view Screenshot of the Grid view... This is the grid view showing a thumbnail of all your images. Each card has helpful meta data (PNG, file size etc) Some images have crop applied denoted by the small pink badge. IE Lisbon tiles has 4 crop versions. Usual filters at the top and a search bar. Screenshot of the Table view. Handy if you have hundreds of images Displays tags too Screenshot of the Upload / Drag and drop mode There's some nice aniamtion / UI when the system is uploading several images Tomorrow I'll share more...
    1 point
  13. AMAZING! Ver interesting idea! Although in general I've always though of this The Media Library of ProcessWire as it's own Inputfield/Process module combo! Second thing, from what I'm understanding, if you'd want to reuse an image in two pages you'd still get two copies right?? Have you thought of using something like flysystem and possibility to have buckets/containers of media . This idea pretty much comes from what I've seen a lot in other CMSs! Maybe there could even be a ProcessWire adapter? So that in instantly catches up on the ProcessWire file structure? Just wishful thinking though! Question, is the UI built with UIKit? UI wise, in general I really like what I see! For sure there's details I would leave out of the first screen, but whatever, not sure it's the moment to comment on small details! Would gladly pay for this module but would also wish it to be open source so that it can be picked up if for some reason dev momentum gets stalled, life happens!
    1 point
  14. Looks really good! I can't wait to try it out. Its really a shame that a media manager module is not part of ProcessWire (yet).
    1 point
  15. https://processwire.com/talk/topic/31724-wip-wiremedia-–-concept-for-a-central-media-management-module/
    1 point
  16. That looks great. I've started one too as of last night. Mainly for my own learning and amusement, but I think a solid, maintained Module like this is badly needed.
    1 point
  17. Hello there! Since I started creating sites with ProcessWire I wished there was a central media management option. You know - a place where you can upload all sorts of data (well, mostly images) to use them throughout the whole website. It is something that nearly every other CMS offers and many clients of me which used Wordpress or Typo3 are used to this kind of media management and it's kind of hard to tell them that this is not possible (in that way) with ProcessWire. I know from the past that there was a Media Manager Module from @kongondo but this module seems not to have been updated in years. Are there any other solutions or techniques that you developers use?
    1 point
  18. Hello all, sharing my new module FieldtypeImageReference. It provides a configurable input field for choosing any type of image from selectable sources. Sources can be: a predefined folder in site/templates/ and/or a page (and optionally its children) and/or the page being edited and/or any page on the site CAUTION: this module is under development and not quite yet in a production-ready state. So please test it carefully. UPDATE: the new version v2.0.0 introduces a breaking change due to renaming the module. If you have an older version already installed, you need to uninstall it and install the latest master version. Module and full description can be found on github https://github.com/gebeer/FieldtypeImageReference Install from URL: https://github.com/gebeer/FieldtypeImageReference/archive/master.zip Read on for features and use cases. Features Images can be loaded from a folder inside site/templates/ or site/assets Images in that folder can be uploaded and deleted from within the inputfield Images can be loaded from other pages defined in the field settings Images can be organized into categories. Child pages of the main 'image source page' serve as categories mages can be loaded from any page on the site From the API side, images can be manipulated like native ProcessWire images (resizing, cropping etc.), even the images from a folder Image thumbnails are loaded into inputfield by ajax on demand Source images on other pages can be edited from within this field. Markup of SVG images can be rendered inline with `echo $image->svgcontent` Image names are fully searchable through the API $pages->find('fieldname.filename=xyz.png'); $pages->find('fieldname.filename%=xy.png'); Accidental image deletion is prevented. When you want to delete an image from one of the pages that hold your site-wide images, the module searches all pages that use that image. If any page contains a reference to the image you are trying to delete, deletion will be prevented. You will get an error message with links to help you edit those pages and remove references there before you can finally delete the image. This field type can be used with marcrura's Settings Factory module to store images on settings pages, which was not possible with other image field types When to use ? If you want to let editors choose an image from a set of images that is being used site-wide. Ideal for images that are being re-used across the site (e.g. icons, but not limited to that). Other than the native ProcessWire images field, the images here are not stored per page. Only references to images that live on other pages or inside a folder are stored. This has several advantages: one central place to organize images when images change, you only have to update them in one place. All references will be updated, too. (Provided the name of the image that has changed stays the same) Installation and setup instructions can be found on github. Here's how the input field looks like in the page editor: If you like to give it a try, I'm happy to hear your comments or suggestions for improvement. Install from URL: https://github.com/gebeer/FieldtypeImageReference/archive/master.zip Eventually this will go in the module directory, too. But it needs some more testing before I submit it. So I'd really appreciate your assistance. Thanks to all who contributed their feedback and suggestions which made this module what it is now.
    1 point
×
×
  • Create New...