Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/10/2025 in all areas

  1. FieldtypeSelect is very old module from 2013 that "produces a drop down list (via a "select" input) that would allow you to define a list of options in the field's configuration from which to select a value. After installing, you'll have a new "Select" fieldtype that will allow you to define the items you'd like in the drop down. You'll be able to define these options in a text box on the field's configuration screen. Just put each option on it's own line." Github Repo: https://github.com/Hani79/Processwire_FieldType_Select_Drop_Down My fork: https://github.com/matjazpotocnik/Processwire_FieldType_Select_Drop_Down You should use FieldtypeOptions nowdays. Can't answer that, see if the fieldtype Select is used in any template?
    3 points
  2. @Stefanowitsch asked about using the File Mover module with a "media library" page that is accessed via a modal. I thought I would share some hook code publicly in case it's useful for others too. // Add a button to file and image fields to open a media library page in a modal // Hook InputfieldFile::render to affect file and image fields, // or InputfieldImage::render to affect only image fields $wire->addHookAfter('InputfieldFile::render', function(HookEvent $event) { $inputfield = $event->object; // The field associated with the inputfield (if any) $field = $inputfield->hasField; // The page containing the inputfield (if any) $page = $inputfield->hasPage; // Don't add the button to fields on the media library page // as we don't want the possibility of nested modals if($page && $page->template == 'media_library') return; // You can also check the field name if the button should only be added to a specific field, e.g. // if($field && $field->name !== 'article_images') return; // Get the media library page $media_library = $event->wire()->pages->get("template=media_library"); // Construct the URL to edit the media library page $url = $media_library->editUrl; // Add &modal=1 so the admin header isn't shown $url .= '&modal=1'; // We don't need other tabs or fields besides the image/file field(s), // so specify the field name(s) in the URL // Unfortunately there is this layout bug: https://github.com/processwire/processwire-issues/issues/1972 $url .= '&field=images,files'; /** @var InputfieldButton $f */ $f = $event->wire()->modules->get('InputfieldButton'); $f->href = $url; $f->value = 'Open media library'; $f->icon = 'picture-o'; // Add pw-modal class so the button link opens in a modal $f->addClass('pw-modal'); // Make it a large modal $f->addClass('pw-modal-large'); // Add a bit of space above the button $f->attr('style', 'margin-top: 10px;'); // Append the rendered button to the inputfield $event->return .= $f->render(); });
    2 points
  3. This means that only the owner of the file can write to it. Does it have the correct owner?
    1 point
  4. @Mike-it - the latest version supports the Options field type but note that you need to use the numeric key for the option rather than the label, so 1 or 2 rather than Yes or No, for example.
    1 point
  5. Can you try disabling FileCompiler for files in templates?? Or I'm just seeing the logNotices options, maybe that? /** * File compiler options (as used by FileCompiler class) * * Enables modification of file compiler behaviors. See also $config->moduleCompile * and $config->templateCompile settings. * * #property bool siteOnly Specify true to prevent compiler from attempting compilation outside files in /site/ (default=false). * #property bool showNotices Show notices in admin about compiled files to superuser when logged in (default=true). * #property bool logNotices Log notices about compiled files and maintenance to file-compiler.txt log (default=true). * #property string chmodFile Mode to use for created files, i.e. "0644" (uses $config->chmodFile setting by default). * #property string chmodDir Mode to use for created dirs, i.e. "0755" (uses $config->chmodDir setting by default). * #property array exclusions Exclude paths that exist within any of these paths (default includes $config->paths->wire). * #property array extensions File extensions that we compile (default=php, module, inc). * #property string cachePath Path where compiled files are stored (default is $config->paths->cache . 'FileCompiler/') * * @var array * */ $config->fileCompilerOptions = array( 'siteOnly' => false, // only allow compilation of files in /site/ directory 'showNotices' => true, // show notices about compiled files to superuser when logged in 'logNotices' => true, // log notices about compiled files and maintenance to file-compiler.txt log. 'chmodFile' => '', // mode to use for created files, i.e. "0644" 'chmodDir' => '', // mode to use for created directories, i.e. "0755" 'exclusions' => array(), // exclude filenames or paths that start with any of these 'extensions' => array('php', 'module', 'inc'), // file extensions we compile 'cachePath' => '', // path where compiled files are stored, or blank for $config->paths->cache . 'FileCompiler/' );
    1 point
  6. SSE (Server-Sent Events) would be a game-changer for ProcessWires core, and the trash functionality example perfectly illustrates why: The Current Problem: As you mentioned, the current trash system is painful - deleting hundreds of pages requires multiple confirmations, long waits, and often timeouts. Your clients shouldn't need API knowledge just to empty their trash efficiently. How SSE Solves This: One-click bulk operations: Start deleting 1000+ pages with a single confirmation Real-time progress: "Deleting page 234 of 1000..." instead of a frozen screen No more timeouts: SSE keeps the connection alive, bypassing PHP execution limits Graceful interruption: Users can safely stop/pause operations if needed Beyond Trash - Core Benefits: I have written several converter or importer modules for my clients, that import data and transform them into pages or a payment matcher module, which compares bank statements with invoice pages inside of ProcessWire. For all of these modules I wrote custom SSE Event handlers myself which is much boilerplate and duplicated code as Bernhard mentioned. Imagine every ProcessWire installation having this built-in: Import/export operations with live feedback Batch page operations (move, publish, unpublish) Asset processing (image optimization, file management) Search index rebuilding Module installations and updates Why Core Integration Matters: Standardized approach: All modules can use the same SSE implementation Better UX across the board: Every long-running operation becomes transparent Developer-friendly: No need to reinvent the wheel for each module Professional feel: Matches modern user expectations from enterprise CMS Addressing Adoption Concerns: I can't predict what percentage of users would use this feature - nobody can provide statistics for something that doesn't exist yet. But consider this: every ProcessWire user who has ever dealt with timeouts, batch operations, or large imports would benefit immediately. The feature would be invisible to those who don't need it, while being invaluable to those who do. Your modules already prove SSE works brilliantly with ProcessWire. Making it core functionality would elevate the entire ecosystem.
    1 point
×
×
  • Create New...