Jump to content

Leaderboard

Popular Content

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

  1. Hi everyone, First of all I had no idea, which category would fit best ... I'd like to share a little tool I've been working on to make the initial setup of ProcessWire even faster, especially when working on remote servers without SSH access. What is it? kickstart.php is a modern, single-file installer/loader for ProcessWire. Instead of uploading thousands of files via FTP, you just upload this one file and it handles the rest. Key Features: Version Selection: Choose between the master (stable) or dev branch directly from GitHub. Smart Multi-Language: Built-in support for English, German, Spanish, and French (with automatic browser language detection). Modern UI: Built with Tailwind CSS, AlpineJS, and smooth animations using Anime.js. Pre-flight Checks: Automatically checks for PHP version requirements and prevents overwriting existing installations. Automatic Cleanup: Removes the downloaded ZIP archive and temporary folders after extraction. How to use it: Upload kickstart.php to your webroot. Open it in your browser. Choose your version and click install. Once finished, click the button to start the official ProcessWire installer. I hope some of you find this useful for your workflow! Feedback and suggestions are always welcome. Cheers, Markus kickstart.php Improved Version now available on GitHub: https://github.com/markusthomas/ProcessWireKickstart
    3 points
  2. Thanks for the feedback! What I can imagine for a future update is adding a step where you can upload or provide a URL for a custom ZIP file (containing a site profile). This way, you could use 'skeletons' from the modules directory or your own private boilerplate. I'll keep this in mind for the next iteration!
    1 point
  3. Send a PR with a fresh README.md that contains what I was looking for.
    1 point
  4. @wbmnfktr Thanks, that is a good point. Now i show a filelist and updated the text: Is now implemented, thanks for this. That's a great suggestion! I actually had the same idea, but I haven't found the time to implement it yet. It's definitely on my to-do list for a future update! I made it available on GitHub: https://github.com/markusthomas/ProcessWireKickstart
    1 point
  5. Hi everyone! πŸ‘‹ I'd like to share SquareImages - a simple module that creates perfect square images from any source format. Born from a real-world need: displaying vertical product images (like Coca-Cola bottles) uniformly in galleries and grids without distortion or awkward sizing. The Problem // Traditional methods don't work well for mixed aspect ratios: $image->width(300); // Too narrow for vertical images $image->height(300); // Too wide $image->size(300, 300); // Distorted The Solution // One simple method - smart cropping, perfect squares: $square = $image->square(300); Key Features 🎯 Smart Cropping - Automatically centers on longer dimension πŸ“¦ Format Preservation - Maintains original format (JPG/PNG/GIF) 🌐 WebP Support - Chain with ->webp() for compression ⚑ Performance - Fast URL generation πŸ’Ύ Automatic Caching - Built on PW's image engine Quick Example <div class="product-grid"> <?php foreach ($page->products as $product): ?> <?php $thumb = $product->photo->square(300); ?> <img src="<?= $thumb->url ?>" alt="<?= $product->title ?>"> <?php endforeach; ?> </div> Perfect uniform squares, regardless of source dimensions! API Methods $image->square(400); // Main method $image->squareWidth(500); // Based on width $image->squareHeight(600); // Based on height $image->getSquareURL(300); // Direct URL (faster) // WebP conversion $image->square(500)->webp(); // 25-65% smaller files Installation GitHub: https://github.com/mxmsmnv/SquareImages cd site/modules/ git clone https://github.com/mxmsmnv/SquareImages.git Or download ZIP and extract to /site/modules/SquareImages/ Then refresh modules in admin and install. Use Cases E-commerce product galleries Team member avatars Blog thumbnails Social media previews Instagram-style grids
    1 point
  6. @Pixrael And @maximusthank you so much for such valuable guidance and suggestions. Now, I am understanding a little how to provide solutions to the client based on my experience and knowledge. I am relatively new to web development, and I have a dream of starting a digital agency that provides services to grow and scale small businesses with the help of digital technology. With your guidance, I will dive more deeply into the topics to strengthen my skills. I assume that every developer and business has a good workflow or ways of delivering services to the client to tailor to their needs. I would appreciate it a lot if anyone could suggest or guide how they are delivering such services to the client using ProcessWire and other services, as suggested by Pixrael and Maximus. One day, I will also contribute to the ProcessWire community as my experience grows, guiding new people to unleash the superpower of this CMS framework. Thank You All !
    1 point
  7. Awesome! Yes, Opus 4.5 is really good now with PW. It also helps a lot that they have implemented the LSP in Claude Code directly. Honestly, at this stage I don't think we even need to feed docs to it anymore. Just instructions to explore the relevant API methods for a task itself itself in the codebase. Is there a specific reason why you implemented that as MCP and not as Skill? MCPs eat a lot of context. Depends on the implementation, of course. So dunno about how much context Octopus occupies. ATM I have some basic instructions in CLAUDE.md that explain how to bootstrap PW and use the CLI through ddev for exploration, debugging, DB queries. That makes a big difference already. Opus is great at exploring stuff through the PHP CLI, either as one-liners or as script files for more complex stuff. Here's my current instructions: ## PHP CLI Usage (ddev) All PHP CLI commands **must run through ddev** to use the web container's PHP interpreter. ### Basic Commands ```bash # Run PHP directly ddev php script.php # Check PHP version ddev php --version # Execute arbitrary command in web container ddev exec php script.php # Interactive shell in web container ddev ssh ``` ### ProcessWire Bootstrap Bootstrap ProcessWire by including `./index.php` from project root. After include, full PW API is available (`$pages`, `$page`, `$config`, `$sanitizer`, etc.). **All CLI script files must be placed in `./cli_scripts/`.** **Inline script execution:** ```bash ddev exec php -r "namespace ProcessWire; include('./index.php'); echo \$pages->count('template=product');" ``` **Run a PHP script:** ```bash ddev php cli_scripts/myscript.php ``` **Example CLI script** (`cli_scripts/example.php`): ```php <?php namespace ProcessWire; include(__DIR__ . '/../index.php'); // PW API now available $products = $pages->find('template=product'); foreach ($products as $p) { echo "{$p->id}: {$p->title}\n"; } ``` ### PHP CLI Usage for Debugging & Information Gathering Examples **One-liners** β€” use `ddev php -r` with functions API (`pages()`, `templates()`, `modules()`) to avoid bash `$` variable expansion. Local variables still need escaping (`\$t`). Prefix output with `PHP_EOL` to separate from RockMigrations log noise: ```bash # Count pages by template ddev php -r "namespace ProcessWire; include('./index.php'); echo PHP_EOL.'Products: '.pages()->count('template=product');" # Check module status ddev php -r "namespace ProcessWire; include('./index.php'); echo PHP_EOL.(modules()->isInstalled('ProcessShop') ? 'yes' : 'no');" # List all templates (note \$t escaping for local var) ddev php -r "namespace ProcessWire; include('./index.php'); foreach(templates() as \$t) echo \$t->name.PHP_EOL;" ``` **Script files** β€” preferred for complex queries, place in `./cli_scripts/`: ```php // cli_scripts/inspect_fields.php <?php namespace ProcessWire; include(__DIR__ . '/../index.php'); $p = pages()->get('/'); print_r($p->getFields()->each('name')); ``` ```bash ddev php cli_scripts/inspect_fields.php ``` ### TracyDebugger in CLI **Works in CLI:** - `d($var, $title)` β€” dumps to terminal using `print_r()` for arrays/objects - `TD::dump()` / `TD::dumpBig()` β€” same behavior **Does NOT work in CLI:** - `bd()` / `barDump()` β€” requires browser debug bar **Example:** ```php <?php namespace ProcessWire; include(__DIR__ . '/../index.php'); $page = pages()->get('/'); d($page, 'Home page'); // outputs to terminal d($page->getFields()->each('name'), 'Fields'); ``` ### Direct Database Queries Use `database()` (returns `WireDatabasePDO`, a PDO wrapper) for raw SQL queries: ```php <?php namespace ProcessWire; include(__DIR__ . '/../index.php'); // Prepared statement with named parameter $query = database()->prepare("SELECT * FROM pages WHERE template = :tpl LIMIT 5"); $query->execute(['tpl' => 'product']); $rows = $query->fetchAll(\PDO::FETCH_ASSOC); // Simple query $result = database()->query("SELECT COUNT(*) FROM pages"); echo $result->fetchColumn(); ``` **Key methods:** - `database()->prepare($sql)` β€” prepared statement, use `:param` placeholders - `database()->query($sql)` β€” direct query (no params) - `$query->execute(['param' => $value])` β€” bind and execute - `$query->fetch(\PDO::FETCH_ASSOC)` β€” single row - `$query->fetchAll(\PDO::FETCH_ASSOC)` β€” all rows - `$query->fetchColumn()` β€” single value **Example** (`cli_scripts/query_module_data.php`): ```php <?php namespace ProcessWire; include(__DIR__ . '/../index.php'); $query = database()->prepare("SELECT data FROM modules WHERE class = :class"); $query->execute(['class' => 'ProcessPageListerPro']); $row = $query->fetch(\PDO::FETCH_ASSOC); print_r(json_decode($row['data'], true)); ``` ### ddev Exec Options - `ddev exec --dir /var/www/html/site <cmd>` β€” run from specific directory - `ddev exec -s db <cmd>` β€” run in database container - `ddev mysql` β€” MySQL client access
    1 point
  8. 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
Γ—
Γ—
  • Create New...