Jump to content

Recommended Posts

Posted

Hi all,

You know the moment: you're browsing your own site, you spot a typo in a title, an event that already happened, a date that's wrong. And you sigh, because now it's admin → find the page → edit → scroll → save → go back. Five screens for one word.

So I built Native Command — a command palette for ProcessWire, like Spotlight/Raycast or the VS Code palette. Press Ctrl+K (⌘+K on Mac) on any page of your site, front-end or admin, type a couple of letters, hit Enter. Done.

01-frontend-palette.thumb.jpg.0fc1d68dd55f94845e8d81a93d54ae75.jpg

What can it do?

Things with the page you're looking at: set any simple field (text, number, price, date, checkbox, options, page reference — yes, next friday 19:30 works), publish/unpublish, hide, rename, duplicate, add a child page, move it, trash it.

02-set-field.thumb.jpg.6557a54e10c70764ef763848891444a7.jpg

Undo. Everything. Every change shows a little toast with an Undo button. Your editors will love you. You'll sleep better.

03-undo-toast.thumb.jpg.f2807038e879a96c93761d83ad87536c.jpg

Bulk actions with selectors. "Unpublish all events that already happened": bulk unpublish → template=event, event_date<today → untick the one you want to keep → Enter. You get a summary of what was done and skipped (and why) — and one Undo for the whole batch.

07-bulk-picker.thumb.jpg.952efc60fd6423016dc180ae97ca2070.jpg

"Wait, who uses this page?" Page info shows who created/changed it, URLs in all languages, and which pages reference or link to it. Trash and Move warn you about it automatically, before you break something.

06-page-info.thumb.jpg.5d89e6724a54f2c4c535ceb938e7e6ef.jpg

Search & jump to pages (title, ID, template or a selector), admin screens, templates, fields, modules and users. Every page shows its template and ID — click the ID to copy it.

And a few extras: system info and latest errors right in the palette, clear caches, refresh modules, add a field to a template, your own no-code shortcuts in the settings (New event | new /events/ event | editor), pins, dark mode, and ? for built-in help.

Is it safe to give to editors?

Yes — that was the whole point. Every command, page and field is checked against the user's permissions on the server, every time. Commands use CSRF, risky ones ask first, rich-text fields are never touched, user selectors can't sneak past access control, and changes can be logged. No tables, fields or templates are created — uninstall and it's gone.

For developers

Add your own commands from any module or ready.php — with arguments, page pickers, confirmations, results in the palette and undo:

 
php
$wire->addHookAfter('NativeCommand::registerCommands', function(HookEvent $e) {
    $e->object->addCommand('orders.open', [
        'title' => 'Open orders',
        'mutates' => false,
        'handler' => function() {
            return ['message' => wire('pages')->count('template=order, paid=0') . ' open orders'];
        },
    ]);
});

Extra screens:
04-admin-page-commands.thumb.jpg.7dab3864881c669509bd1433846705cc.jpg 05-search.thumb.jpg.95c36e6b1470997f4a823aee1df256fc.jpg 08-bulk-confirm.thumb.jpg.c299756348137688720ac5384b8cdaa1.jpg
09-bulk-result.thumb.jpg.77a735bf55f10d8d24beb3a090433d42.jpg Help Dark mode

Download

Works on any site, any profile, no dependencies. ProcessWire 3.0.200+, PHP 7.4+.

Download: NativeCommand.zip

Install, press Ctrl+K, type ?.
If you run into any problems or bugs, please let me know and if it saves you even one trip through the page tree, I'll call it a win. 🙂

Cheers

R
 

  • Like 2
  • Thanks 1
Posted

Uuuuh, I love this!

I love that you get the values of selector fields to pick from, when editing one. Icing on top of the cake would be if you can also edit page fields 🙂

PS: by the way, I had to switch to cmd+p because cmd+k was interfeering with the palette command from the Konkat theme (I added that one there, sorry! 😄)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...